Add updateTheme functions to remaining GUI components

This commit is contained in:
Veronica Berglyd Olsen
2022-10-25 23:42:43 +02:00
parent 52ede26f3d
commit 88183cdc39
8 changed files with 113 additions and 66 deletions
+17 -3
View File
@@ -97,6 +97,13 @@ class GuiOutlineView(QWidget):
# Methods
##
def updateTheme(self):
"""Update theme elements.
"""
self.outlineBar.updateTheme()
self.refreshTree()
return
def initSettings(self):
"""Initialise GUI elements that depend on specific settings.
"""
@@ -213,7 +220,6 @@ class GuiOutlineToolBar(QToolBar):
self.setMovable(False)
self.setIconSize(QSize(iPx, iPx))
self.setContentsMargins(0, 0, 0, 0)
self.setStyleSheet("QToolBar {border: 0px;}")
stretch = QWidget(self)
stretch.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
@@ -228,7 +234,6 @@ class GuiOutlineToolBar(QToolBar):
# Actions
self.aRefresh = QAction(self.tr("Refresh"), self)
self.aRefresh.setIcon(self.mainTheme.getIcon("refresh"))
self.aRefresh.triggered.connect(self._refreshRequested)
# Column Menu
@@ -238,7 +243,6 @@ class GuiOutlineToolBar(QToolBar):
)
self.tbColumns = QToolButton(self)
self.tbColumns.setIcon(self.mainTheme.getIcon("menu"))
self.tbColumns.setMenu(self.mColumns)
self.tbColumns.setPopupMode(QToolButton.InstantPopup)
@@ -258,6 +262,16 @@ class GuiOutlineToolBar(QToolBar):
# Methods
##
def updateTheme(self):
"""Update theme elements.
"""
self.setStyleSheet("QToolBar {border: 0px;}")
self.aRefresh.setIcon(self.mainTheme.getIcon("refresh"))
self.tbColumns.setIcon(self.mainTheme.getIcon("menu"))
return
def populateNovelList(self):
"""Fill the novel combo box with a list of all novel folders.
"""