Skip to content

Commit

Permalink
Adding SVG_LIGHT_THEME_TEXT_COLOR to define the app/tray icon text co…
Browse files Browse the repository at this point in the history
…lor (issue #55)
  • Loading branch information
digitaltrails committed Sep 25, 2023
1 parent 8e8b25c commit 64ce3fe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vdu_controls.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,9 @@ class MsgDestination(Enum):
SYSTEM_TRAY_WAIT_SECONDS = 20

SVG_LIGHT_THEME_COLOR = b"#232629"
SVG_LIGHT_THEME_TEXT_COLOR = b"#000000"
SVG_DARK_THEME_COLOR = b"#f3f3f3"
SVG_DARK_THEME_TEXT_COLOR = SVG_DARK_THEME_COLOR

# modified brightness icon from breeze5-icons: LGPL-3.0-only
BRIGHTNESS_SVG = b"""
Expand Down Expand Up @@ -4932,9 +4934,11 @@ def create_icon_from_text(text: str, themed: bool = True) -> QIcon:
painter = QPainter(pixmap)
font = QApplication.font()
font.setPixelSize(24)
font.setWeight(QFont.Medium)
painter.setFont(font)
painter.setOpacity(1.0)
painter.setPen(QColor((SVG_DARK_THEME_COLOR if themed and is_dark_theme() else SVG_LIGHT_THEME_COLOR).decode("utf-8")))
painter.setPen(
QColor((SVG_DARK_THEME_TEXT_COLOR if themed and is_dark_theme() else SVG_LIGHT_THEME_TEXT_COLOR).decode("utf-8")))
painter.drawText(pixmap.rect(), Qt.AlignTop, text)
painter.end()
return QIcon(pixmap)
Expand Down

0 comments on commit 64ce3fe

Please sign in to comment.