fix color palette option not being correctly disabled on first show when ui style is set to system

This commit is contained in:
Kovid Goyal 2022-07-19 22:23:12 +05:30
parent 876ab0b19f
commit b9da583a98
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -396,9 +396,11 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
def genesis(self, gui):
self.gui = gui
self.ui_style_available = True
if not ismacos and not iswindows:
self.label_widget_style.setVisible(False)
self.opt_ui_style.setVisible(False)
self.ui_style_available = False
db = gui.library_view.model().db
@ -636,7 +638,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
self.update_color_palette_state()
def update_color_palette_state(self):
if self.opt_ui_style.isVisible():
if self.ui_style_available:
enabled = self.opt_ui_style.currentData() == 'calibre'
self.opt_color_palette.setEnabled(enabled)
self.opt_color_palette_label.setEnabled(enabled)