mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Windows: Book details panel: Fix selection not visible when using the system default theme
This commit is contained in:
parent
b0ddcfdc5a
commit
5203dc48d3
@ -1287,6 +1287,10 @@ class Application(QApplication):
|
|||||||
if cft >= 0:
|
if cft >= 0:
|
||||||
self.setCursorFlashTime(int(cft))
|
self.setCursorFlashTime(int(cft))
|
||||||
|
|
||||||
|
@property
|
||||||
|
def using_calibre_style(self) -> bool:
|
||||||
|
return self.palette_manager.using_calibre_style
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_dark_theme(self):
|
def is_dark_theme(self):
|
||||||
return self.palette_manager.is_dark_theme
|
return self.palette_manager.is_dark_theme
|
||||||
|
@ -1061,6 +1061,12 @@ class BookInfo(HTMLDisplay):
|
|||||||
ac.current_url = ac.current_fmt = None
|
ac.current_url = ac.current_fmt = None
|
||||||
self.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
self.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||||
self.setDefaultStyleSheet(css())
|
self.setDefaultStyleSheet(css())
|
||||||
|
if iswindows and not QApplication.instance().using_calibre_style:
|
||||||
|
# workaround Qt bug that causes selected text to be invisible on
|
||||||
|
# windows when using system theme
|
||||||
|
bg = self.palette().color(QPalette.ColorRole.Highlight).name()
|
||||||
|
fg = self.palette().color(QPalette.ColorRole.HighlightedText).name()
|
||||||
|
self.setStyleSheet(f'QTextBrowser {{ selection-color: {fg}; selection-background-color: {bg}; }}')
|
||||||
|
|
||||||
def change_layout(self, vertical):
|
def change_layout(self, vertical):
|
||||||
if vertical != self.vertical:
|
if vertical != self.vertical:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user