fix night mode tooltips
This commit is contained in:
parent
cc648195e4
commit
e3fb184a84
@ -89,6 +89,13 @@ QTreeWidget {
|
|||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if self.night_mode:
|
||||||
|
buf += """
|
||||||
|
QToolTip {
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|
||||||
# allow addons to modify the styling
|
# allow addons to modify the styling
|
||||||
buf = gui_hooks.style_did_init(buf)
|
buf = gui_hooks.style_did_init(buf)
|
||||||
|
|
||||||
@ -104,7 +111,6 @@ QTreeWidget {
|
|||||||
|
|
||||||
text_fg = self.qcolor("text-fg")
|
text_fg = self.qcolor("text-fg")
|
||||||
palette.setColor(QPalette.WindowText, text_fg)
|
palette.setColor(QPalette.WindowText, text_fg)
|
||||||
palette.setColor(QPalette.ToolTipBase, text_fg)
|
|
||||||
palette.setColor(QPalette.ToolTipText, text_fg)
|
palette.setColor(QPalette.ToolTipText, text_fg)
|
||||||
palette.setColor(QPalette.Text, text_fg)
|
palette.setColor(QPalette.Text, text_fg)
|
||||||
palette.setColor(QPalette.ButtonText, text_fg)
|
palette.setColor(QPalette.ButtonText, text_fg)
|
||||||
@ -119,7 +125,9 @@ QTreeWidget {
|
|||||||
palette.setColor(QPalette.AlternateBase, window_bg)
|
palette.setColor(QPalette.AlternateBase, window_bg)
|
||||||
palette.setColor(QPalette.Button, window_bg)
|
palette.setColor(QPalette.Button, window_bg)
|
||||||
|
|
||||||
palette.setColor(QPalette.Base, self.qcolor("frame-bg"))
|
frame_bg = self.qcolor("frame-bg")
|
||||||
|
palette.setColor(QPalette.Base, frame_bg)
|
||||||
|
palette.setColor(QPalette.ToolTipBase, frame_bg)
|
||||||
|
|
||||||
disabled_color = self.qcolor("disabled")
|
disabled_color = self.qcolor("disabled")
|
||||||
palette.setColor(QPalette.Disabled, QPalette.Text, disabled_color)
|
palette.setColor(QPalette.Disabled, QPalette.Text, disabled_color)
|
||||||
|
@ -11,6 +11,7 @@ import aqt
|
|||||||
from anki.lang import _
|
from anki.lang import _
|
||||||
from anki.utils import invalidFilename, isMac, isWin, noBundledLibs, versionWithBuild
|
from anki.utils import invalidFilename, isMac, isWin, noBundledLibs, versionWithBuild
|
||||||
from aqt.qt import *
|
from aqt.qt import *
|
||||||
|
from aqt.theme import theme_manager
|
||||||
|
|
||||||
|
|
||||||
def aqt_data_folder() -> str:
|
def aqt_data_folder() -> str:
|
||||||
@ -551,10 +552,11 @@ def tooltip(msg, period=3000, parent=None):
|
|||||||
lab.setFrameStyle(QFrame.Panel)
|
lab.setFrameStyle(QFrame.Panel)
|
||||||
lab.setLineWidth(2)
|
lab.setLineWidth(2)
|
||||||
lab.setWindowFlags(Qt.ToolTip)
|
lab.setWindowFlags(Qt.ToolTip)
|
||||||
p = QPalette()
|
if not theme_manager.night_mode:
|
||||||
p.setColor(QPalette.Window, QColor("#feffc4"))
|
p = QPalette()
|
||||||
p.setColor(QPalette.WindowText, QColor("#000000"))
|
p.setColor(QPalette.Window, QColor("#feffc4"))
|
||||||
lab.setPalette(p)
|
p.setColor(QPalette.WindowText, QColor("#000000"))
|
||||||
|
lab.setPalette(p)
|
||||||
lab.move(aw.mapToGlobal(QPoint(0, -100 + aw.height())))
|
lab.move(aw.mapToGlobal(QPoint(0, -100 + aw.height())))
|
||||||
lab.show()
|
lab.show()
|
||||||
_tooltipTimer = aqt.mw.progress.timer(
|
_tooltipTimer = aqt.mw.progress.timer(
|
||||||
|
Loading…
Reference in New Issue
Block a user