Add icon colour settings to themes and enforce them on all GUI icons

This commit is contained in:
Veronica Berglyd Olsen
2025-10-26 14:02:18 +01:00
parent 2c1c46b98d
commit 6db67e909d
25 changed files with 216 additions and 187 deletions
+27 -27
View File
@@ -2489,17 +2489,17 @@ class GuiDocToolBar(QWidget):
palette.setColor(QPalette.ColorRole.Text, syntax.text)
self.setPalette(palette)
self.tbBoldMD.setThemeIcon("fmt_bold", "orange")
self.tbItalicMD.setThemeIcon("fmt_italic", "orange")
self.tbStrikeMD.setThemeIcon("fmt_strike", "orange")
self.tbMarkMD.setThemeIcon("fmt_mark", "orange")
self.tbBold.setThemeIcon("fmt_bold")
self.tbItalic.setThemeIcon("fmt_italic")
self.tbStrike.setThemeIcon("fmt_strike")
self.tbUnderline.setThemeIcon("fmt_underline")
self.tbMark.setThemeIcon("fmt_mark")
self.tbSuperscript.setThemeIcon("fmt_superscript")
self.tbSubscript.setThemeIcon("fmt_subscript")
self.tbBoldMD.setThemeIcon("fmt_bold", "mdformat")
self.tbItalicMD.setThemeIcon("fmt_italic", "mdformat")
self.tbStrikeMD.setThemeIcon("fmt_strike", "mdformat")
self.tbMarkMD.setThemeIcon("fmt_mark", "mdformat")
self.tbBold.setThemeIcon("fmt_bold", "scformat")
self.tbItalic.setThemeIcon("fmt_italic", "scformat")
self.tbStrike.setThemeIcon("fmt_strike", "scformat")
self.tbUnderline.setThemeIcon("fmt_underline", "scformat")
self.tbMark.setThemeIcon("fmt_mark", "scformat")
self.tbSuperscript.setThemeIcon("fmt_superscript", "scformat")
self.tbSubscript.setThemeIcon("fmt_subscript", "scformat")
class GuiDocEditSearch(QFrame):
@@ -2727,16 +2727,16 @@ class GuiDocEditSearch(QFrame):
self.replaceBox.setPalette(palette)
# Set icons
self.toggleCase.setIcon(SHARED.theme.getIcon("search_case"))
self.toggleWord.setIcon(SHARED.theme.getIcon("search_word"))
self.toggleRegEx.setIcon(SHARED.theme.getIcon("search_regex"))
self.toggleLoop.setIcon(SHARED.theme.getIcon("search_loop"))
self.toggleProject.setIcon(SHARED.theme.getIcon("search_project"))
self.toggleMatchCap.setIcon(SHARED.theme.getIcon("search_preserve"))
self.cancelSearch.setIcon(SHARED.theme.getIcon("search_cancel"))
self.searchButton.setThemeIcon("search", "green")
self.replaceButton.setThemeIcon("search_replace", "green")
self.showReplace.setThemeIcon("unfold")
self.toggleCase.setIcon(SHARED.theme.getIcon("search_case", "tool"))
self.toggleWord.setIcon(SHARED.theme.getIcon("search_word", "tool"))
self.toggleRegEx.setIcon(SHARED.theme.getIcon("search_regex", "tool"))
self.toggleLoop.setIcon(SHARED.theme.getIcon("search_loop", "tool"))
self.toggleProject.setIcon(SHARED.theme.getIcon("search_project", "tool"))
self.toggleMatchCap.setIcon(SHARED.theme.getIcon("search_preserve", "tool"))
self.cancelSearch.setIcon(SHARED.theme.getIcon("search_cancel", "tool"))
self.searchButton.setThemeIcon("search", "action")
self.replaceButton.setThemeIcon("search_replace", "apply")
self.showReplace.setThemeIcon("unfold", "default")
# Set stylesheets
self.searchOpt.setStyleSheet("QToolBar {padding: 0;}")
@@ -2967,11 +2967,11 @@ class GuiDocEditHeader(QWidget):
"""Update theme elements."""
logger.debug("Theme Update: GuiDocEditHeader")
self.tbButton.setThemeIcon("fmt_toolbar", "blue")
self.outlineButton.setThemeIcon("list", "blue")
self.searchButton.setThemeIcon("search", "blue")
self.minmaxButton.setThemeIcon("maximise", "blue")
self.closeButton.setThemeIcon("close", "red")
self.tbButton.setThemeIcon("fmt_toolbar", "action")
self.outlineButton.setThemeIcon("list", "action")
self.searchButton.setThemeIcon("search", "action")
self.minmaxButton.setThemeIcon("maximise", "action")
self.closeButton.setThemeIcon("close", "reject")
buttonStyle = SHARED.theme.getStyleSheet(STYLES_MIN_TOOLBUTTON)
self.tbButton.setStyleSheet(buttonStyle)
@@ -3037,7 +3037,7 @@ class GuiDocEditHeader(QWidget):
@pyqtSlot(bool)
def _focusModeChanged(self, focusMode: bool) -> None:
"""Update minimise/maximise icon of the Focus Mode button."""
self.minmaxButton.setThemeIcon("minimise" if focusMode else "maximise", "blue")
self.minmaxButton.setThemeIcon("minimise" if focusMode else "maximise", "action")
##
# Events