Skip to content

Commit

Permalink
style: added tooltip stylesheet for dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ElpadoCan committed Jun 14, 2023
1 parent 35e6f0b commit 06026d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cellacdc/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,11 @@ def __init__(self, app, parent=None):
self.checkConfigFiles()

scheme = self.getColorScheme()
from _palettes import getPaletteColorScheme
from _palettes import getPaletteColorScheme, setToolTipStyleSheet
self.app = app
palette = getPaletteColorScheme(app.palette(), scheme=scheme)
app.setPalette(palette)
setToolTipStyleSheet(app, scheme=scheme)
self.welcomeGuide = None

super().__init__(parent)
Expand Down
14 changes: 13 additions & 1 deletion cellacdc/_palettes.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,16 @@ def lineedit_invalid_entry_stylesheet():
'border: 1.5px solid red;'
'padding: 1px 0px 1px 0px'
)


def setToolTipStyleSheet(app, scheme='light'):
if scheme == 'dark':
app.setStyleSheet(r"QToolTip {"
"color: #e6e6e6; background-color: #3c3c3c; border: 1px solid white;"
"}"
)
else:
app.setStyleSheet(r"QToolTip {"
"color: #141414; background-color: #ffffff; border: 1px solid black;"
"}"
)

0 comments on commit 06026d8

Please sign in to comment.