set message priority color in stylesheet

This commit is contained in:
dries.k
2023-05-31 21:11:45 +02:00
parent c57e3d5bca
commit c1323fefed
4 changed files with 32 additions and 22 deletions

View File

@@ -5,6 +5,7 @@ import subprocess
from pathlib import Path
from typing import Iterator
from PyQt6 import QtWidgets
from gotify_tray import gotify
from gotify_tray.database import Downloader
@@ -95,3 +96,9 @@ def get_icon(name: str) -> str:
name += "-macos"
return get_abs_path(f"gotify_tray/gui/images/{name}.png")
def update_widget_property(widget: QtWidgets.QWidget, property: str, value: str):
widget.setProperty(property, value)
widget.style().unpolish(widget)
widget.style().polish(widget)
widget.update()