Disable the color theme setting when using system style. Fixes #1981909 [Dark Mode always on when using System Default User Interface](https://bugs.launchpad.net/calibre/+bug/1981909)

This commit is contained in:
Kovid Goyal 2022-07-17 12:25:17 +05:30
parent 11b84f7c90
commit 62207d5e85
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 12 additions and 2 deletions

View File

@ -632,6 +632,14 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
self.sections_view.setSpacing(4)
self.sections_view.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
self.tabWidget.currentWidget().setFocus(Qt.FocusReason.OtherFocusReason)
self.opt_ui_style.currentIndexChanged.connect(self.update_color_palette_state)
self.update_color_palette_state()
def update_color_palette_state(self):
if self.opt_ui_style.isVisible():
enabled = self.opt_ui_style.currentData() == 'calibre'
self.opt_color_palette.setEnabled(enabled)
self.opt_color_palette_label.setEnabled(enabled)
def em_export_layout(self):
filename = choose_save_file(self, 'em_import_export_field_list',

View File

@ -296,7 +296,7 @@
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_20">
<widget class="QLabel" name="opt_color_palette_label">
<property name="text">
<string>Color &amp;palette (needs restart):</string>
</property>
@ -308,7 +308,9 @@
<item row="2" column="1">
<widget class="QComboBox" name="opt_color_palette">
<property name="toolTip">
<string>The colors to use for the calibre interface. By default the system colors are used. You can change this to force a light or dark color scheme. Note that if this is not set to system default then if the system wide color scheme is changed calibre will not follow it.</string>
<string>&lt;p&gt;The colors to use for the calibre interface. By default the system colors are used. You can change this to force a light or dark color scheme. Note that if this is not set to system default then if the system wide color scheme is changed calibre will not follow it.
&lt;p&gt;Also, if you set the calibre &lt;i&gt;User interface style&lt;/i&gt; to &lt;i&gt;System default&lt;/i&gt;, then this setting will not take effect and system colors will always be used.</string>
</property>
</widget>
</item>