mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix restore defaults
This commit is contained in:
parent
b7382d6f52
commit
1392a95abc
@ -38,7 +38,7 @@ class Color(QWidget):
|
|||||||
l.addWidget(la)
|
l.addWidget(la)
|
||||||
|
|
||||||
def restore_defaults(self):
|
def restore_defaults(self):
|
||||||
self.button.color = self.default_palette.color(*self.color_key)
|
self.button.color = self.default_palette.color(*self.color_key).name()
|
||||||
|
|
||||||
def color_changed(self):
|
def color_changed(self):
|
||||||
self.changed.emit()
|
self.changed.emit()
|
||||||
@ -178,6 +178,7 @@ class PaletteConfig(Dialog):
|
|||||||
with gprefs:
|
with gprefs:
|
||||||
self.light_tab.apply_settings()
|
self.light_tab.apply_settings()
|
||||||
self.dark_tab.apply_settings()
|
self.dark_tab.apply_settings()
|
||||||
|
Application.instance().palette_manager.refresh_palette()
|
||||||
|
|
||||||
def restore_defaults(self):
|
def restore_defaults(self):
|
||||||
self.light_tab.restore_defaults()
|
self.light_tab.restore_defaults()
|
||||||
|
@ -392,6 +392,12 @@ QTabBar::tab:only-one {
|
|||||||
self.set_palette(pal)
|
self.set_palette(pal)
|
||||||
self.on_palette_change()
|
self.on_palette_change()
|
||||||
|
|
||||||
|
def refresh_palette(self):
|
||||||
|
is_dark = QApplication.instance().palette().is_dark_theme()
|
||||||
|
pal = dark_palette() if is_dark else light_palette()
|
||||||
|
self.set_palette(pal)
|
||||||
|
self.on_palette_change()
|
||||||
|
|
||||||
def tree_view_hover_style(self):
|
def tree_view_hover_style(self):
|
||||||
g1, g2 = '#e7effd', '#cbdaf1'
|
g1, g2 = '#e7effd', '#cbdaf1'
|
||||||
border_size = '1px'
|
border_size = '1px'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user