Follow the system theme and set the icons accordingly, no more handcrafted theming
@@ -60,8 +60,6 @@ def init_logger(logger: logging.Logger):
|
||||
|
||||
class MainApplication(QtWidgets.QApplication):
|
||||
def init_ui(self):
|
||||
set_theme(self, settings.value("theme", type=str))
|
||||
|
||||
self.gotify_client = gotify.GotifyClient(
|
||||
settings.value("Server/url", type=str),
|
||||
settings.value("Server/client_token", type=str),
|
||||
@@ -97,6 +95,9 @@ class MainApplication(QtWidgets.QApplication):
|
||||
|
||||
self.watchdog.start()
|
||||
|
||||
def set_theme(self):
|
||||
set_theme(self)
|
||||
|
||||
def refresh_applications(self):
|
||||
self.messages_model.clear()
|
||||
self.application_model.clear()
|
||||
@@ -299,9 +300,9 @@ class MainApplication(QtWidgets.QApplication):
|
||||
if image_popup := getattr(self, "image_popup", None):
|
||||
image_popup.close()
|
||||
|
||||
def theme_change_requested_callback(self, theme: str):
|
||||
def theme_change_requested_callback(self, *args):
|
||||
# Set the theme
|
||||
set_theme(self, theme)
|
||||
self.set_theme()
|
||||
|
||||
# Update the main window icons
|
||||
self.main_window.set_icons()
|
||||
@@ -314,7 +315,6 @@ class MainApplication(QtWidgets.QApplication):
|
||||
def settings_callback(self):
|
||||
settings_dialog = SettingsDialog()
|
||||
settings_dialog.quit_requested.connect(self.quit)
|
||||
settings_dialog.theme_change_requested.connect(self.theme_change_requested_callback)
|
||||
accepted = settings_dialog.exec()
|
||||
|
||||
if accepted and settings_dialog.settings_changed:
|
||||
@@ -363,7 +363,7 @@ class MainApplication(QtWidgets.QApplication):
|
||||
self.main_window.hidden.connect(self.main_window_hidden_callback)
|
||||
self.main_window.activated.connect(self.tray.revert_icon)
|
||||
|
||||
self.styleHints().colorSchemeChanged.connect(lambda _: self.theme_change_requested_callback(settings.value("theme", type=str)))
|
||||
self.styleHints().colorSchemeChanged.connect(self.theme_change_requested_callback)
|
||||
|
||||
self.messages_model.rowsInserted.connect(self.main_window.display_message_widgets)
|
||||
|
||||
@@ -401,6 +401,7 @@ def start_gui():
|
||||
app.setQuitOnLastWindowClosed(False)
|
||||
app.setWindowIcon(QtGui.QIcon(get_icon("gotify-small")))
|
||||
app.setStyle("fusion")
|
||||
app.set_theme()
|
||||
|
||||
init_logger(logger)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Form implementation generated from reading ui file 'gotify_tray/gui/designs\widget_main.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.1.0
|
||||
# Created by: PyQt6 UI code generator 6.5.0
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
@@ -13,18 +13,18 @@ class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
MainWindow.setObjectName("MainWindow")
|
||||
MainWindow.resize(809, 647)
|
||||
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
||||
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
|
||||
self.gridLayout.setContentsMargins(4, 4, 4, 4)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.splitter = QtWidgets.QSplitter(self.centralwidget)
|
||||
self.splitter = QtWidgets.QSplitter(parent=self.centralwidget)
|
||||
self.splitter.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.splitter.setObjectName("splitter")
|
||||
self.listView_applications = QtWidgets.QListView(self.splitter)
|
||||
self.listView_applications = QtWidgets.QListView(parent=self.splitter)
|
||||
self.listView_applications.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
|
||||
self.listView_applications.setObjectName("listView_applications")
|
||||
self.verticalLayoutWidget = QtWidgets.QWidget(self.splitter)
|
||||
self.verticalLayoutWidget = QtWidgets.QWidget(parent=self.splitter)
|
||||
self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
|
||||
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
@@ -33,21 +33,21 @@ class Ui_MainWindow(object):
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem)
|
||||
self.label_application = QtWidgets.QLabel(self.verticalLayoutWidget)
|
||||
self.label_application = QtWidgets.QLabel(parent=self.verticalLayoutWidget)
|
||||
self.label_application.setObjectName("label_application")
|
||||
self.horizontalLayout.addWidget(self.label_application)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem1)
|
||||
self.pb_refresh = QtWidgets.QPushButton(self.verticalLayoutWidget)
|
||||
self.pb_refresh = QtWidgets.QPushButton(parent=self.verticalLayoutWidget)
|
||||
self.pb_refresh.setText("")
|
||||
self.pb_refresh.setObjectName("pb_refresh")
|
||||
self.horizontalLayout.addWidget(self.pb_refresh)
|
||||
self.pb_delete_all = QtWidgets.QPushButton(self.verticalLayoutWidget)
|
||||
self.pb_delete_all = QtWidgets.QPushButton(parent=self.verticalLayoutWidget)
|
||||
self.pb_delete_all.setText("")
|
||||
self.pb_delete_all.setObjectName("pb_delete_all")
|
||||
self.horizontalLayout.addWidget(self.pb_delete_all)
|
||||
self.verticalLayout_2.addLayout(self.horizontalLayout)
|
||||
self.listView_messages = QtWidgets.QListView(self.verticalLayoutWidget)
|
||||
self.listView_messages = QtWidgets.QListView(parent=self.verticalLayoutWidget)
|
||||
self.listView_messages.setAutoScroll(True)
|
||||
self.listView_messages.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
|
||||
self.listView_messages.setVerticalScrollMode(QtWidgets.QAbstractItemView.ScrollMode.ScrollPerPixel)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Form implementation generated from reading ui file 'gotify_tray/gui/designs\widget_message.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.4.0
|
||||
# Created by: PyQt6 UI code generator 6.5.0
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
@@ -18,7 +18,7 @@ class Ui_Form(object):
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setHorizontalSpacing(0)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.frame = QtWidgets.QFrame(Form)
|
||||
self.frame = QtWidgets.QFrame(parent=Form)
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
|
||||
self.frame.setObjectName("frame")
|
||||
@@ -27,7 +27,7 @@ class Ui_Form(object):
|
||||
self.gridLayout_frame.setContentsMargins(0, 0, -1, 0)
|
||||
self.gridLayout_frame.setVerticalSpacing(3)
|
||||
self.gridLayout_frame.setObjectName("gridLayout_frame")
|
||||
self.label_message = QtWidgets.QLabel(self.frame)
|
||||
self.label_message = QtWidgets.QLabel(parent=self.frame)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
@@ -41,7 +41,7 @@ class Ui_Form(object):
|
||||
self.label_message.setTextInteractionFlags(QtCore.Qt.TextInteractionFlag.LinksAccessibleByMouse|QtCore.Qt.TextInteractionFlag.TextSelectableByMouse)
|
||||
self.label_message.setObjectName("label_message")
|
||||
self.gridLayout_frame.addWidget(self.label_message, 4, 3, 1, 4)
|
||||
self.pb_delete = QtWidgets.QPushButton(self.frame)
|
||||
self.pb_delete = QtWidgets.QPushButton(parent=self.frame)
|
||||
self.pb_delete.setText("")
|
||||
self.pb_delete.setFlat(True)
|
||||
self.pb_delete.setObjectName("pb_delete")
|
||||
@@ -50,14 +50,14 @@ class Ui_Form(object):
|
||||
self.gridLayout_frame.addItem(spacerItem, 1, 4, 1, 1)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(0, 2, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
self.gridLayout_frame.addItem(spacerItem1, 0, 3, 1, 4)
|
||||
self.label_date = QtWidgets.QLabel(self.frame)
|
||||
self.label_date = QtWidgets.QLabel(parent=self.frame)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(11)
|
||||
self.label_date.setFont(font)
|
||||
self.label_date.setTextInteractionFlags(QtCore.Qt.TextInteractionFlag.LinksAccessibleByMouse|QtCore.Qt.TextInteractionFlag.TextSelectableByMouse)
|
||||
self.label_date.setObjectName("label_date")
|
||||
self.gridLayout_frame.addWidget(self.label_date, 1, 5, 1, 1)
|
||||
self.label_title = QtWidgets.QLabel(self.frame)
|
||||
self.label_title = QtWidgets.QLabel(parent=self.frame)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
@@ -72,11 +72,11 @@ class Ui_Form(object):
|
||||
self.label_title.setTextInteractionFlags(QtCore.Qt.TextInteractionFlag.LinksAccessibleByMouse|QtCore.Qt.TextInteractionFlag.TextSelectableByMouse)
|
||||
self.label_title.setObjectName("label_title")
|
||||
self.gridLayout_frame.addWidget(self.label_title, 1, 3, 1, 1)
|
||||
self.label_image = QtWidgets.QLabel(self.frame)
|
||||
self.label_image = QtWidgets.QLabel(parent=self.frame)
|
||||
self.label_image.setText("")
|
||||
self.label_image.setObjectName("label_image")
|
||||
self.gridLayout_frame.addWidget(self.label_image, 1, 2, 1, 1)
|
||||
self.label_priority = QtWidgets.QLabel(self.frame)
|
||||
self.label_priority = QtWidgets.QLabel(parent=self.frame)
|
||||
self.label_priority.setMaximumSize(QtCore.QSize(6, 16777215))
|
||||
self.label_priority.setText("")
|
||||
self.label_priority.setObjectName("label_priority")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Form implementation generated from reading ui file 'gotify_tray/gui/designs\widget_server.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.1.0
|
||||
# Created by: PyQt6 UI code generator 6.5.0
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
@@ -15,36 +15,36 @@ class Ui_Dialog(object):
|
||||
Dialog.resize(300, 130)
|
||||
self.gridLayout = QtWidgets.QGridLayout(Dialog)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.label_server_info = QtWidgets.QLabel(Dialog)
|
||||
self.label_server_info = QtWidgets.QLabel(parent=Dialog)
|
||||
self.label_server_info.setText("")
|
||||
self.label_server_info.setObjectName("label_server_info")
|
||||
self.gridLayout.addWidget(self.label_server_info, 1, 1, 1, 2)
|
||||
self.formLayout = QtWidgets.QFormLayout()
|
||||
self.formLayout.setObjectName("formLayout")
|
||||
self.label = QtWidgets.QLabel(Dialog)
|
||||
self.label = QtWidgets.QLabel(parent=Dialog)
|
||||
self.label.setObjectName("label")
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label)
|
||||
self.line_url = QtWidgets.QLineEdit(Dialog)
|
||||
self.line_url = QtWidgets.QLineEdit(parent=Dialog)
|
||||
self.line_url.setObjectName("line_url")
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.line_url)
|
||||
self.label_2 = QtWidgets.QLabel(Dialog)
|
||||
self.label_2 = QtWidgets.QLabel(parent=Dialog)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_2)
|
||||
self.line_token = QtWidgets.QLineEdit(Dialog)
|
||||
self.line_token = QtWidgets.QLineEdit(parent=Dialog)
|
||||
self.line_token.setObjectName("line_token")
|
||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.line_token)
|
||||
self.gridLayout.addLayout(self.formLayout, 0, 1, 1, 5)
|
||||
self.pb_test = QtWidgets.QPushButton(Dialog)
|
||||
self.pb_test = QtWidgets.QPushButton(parent=Dialog)
|
||||
self.pb_test.setObjectName("pb_test")
|
||||
self.gridLayout.addWidget(self.pb_test, 1, 5, 1, 1)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=Dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 2, 5, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.gridLayout.addItem(spacerItem, 1, 3, 1, 1)
|
||||
self.pb_import = QtWidgets.QPushButton(Dialog)
|
||||
self.pb_import = QtWidgets.QPushButton(parent=Dialog)
|
||||
self.pb_import.setMaximumSize(QtCore.QSize(30, 16777215))
|
||||
self.pb_import.setObjectName("pb_import")
|
||||
self.gridLayout.addWidget(self.pb_import, 1, 4, 1, 1)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Form implementation generated from reading ui file 'gotify_tray/gui/designs\widget_settings.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.4.0
|
||||
# Created by: PyQt6 UI code generator 6.5.0
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
@@ -12,91 +12,80 @@ from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(415, 450)
|
||||
Dialog.resize(415, 420)
|
||||
self.gridLayout = QtWidgets.QGridLayout(Dialog)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=Dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Apply|QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 1, 0, 1, 1)
|
||||
self.tabWidget = QtWidgets.QTabWidget(Dialog)
|
||||
self.tabWidget = QtWidgets.QTabWidget(parent=Dialog)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.tab_general = QtWidgets.QWidget()
|
||||
self.tab_general.setObjectName("tab_general")
|
||||
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.tab_general)
|
||||
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||
self.groupBox_notifications = QtWidgets.QGroupBox(self.tab_general)
|
||||
self.groupBox_notifications = QtWidgets.QGroupBox(parent=self.tab_general)
|
||||
self.groupBox_notifications.setObjectName("groupBox_notifications")
|
||||
self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox_notifications)
|
||||
self.gridLayout_4.setObjectName("gridLayout_4")
|
||||
self.label_notification_duration = QtWidgets.QLabel(self.groupBox_notifications)
|
||||
self.label_notification_duration = QtWidgets.QLabel(parent=self.groupBox_notifications)
|
||||
self.label_notification_duration.setObjectName("label_notification_duration")
|
||||
self.gridLayout_4.addWidget(self.label_notification_duration, 1, 0, 1, 1)
|
||||
self.spin_duration = QtWidgets.QSpinBox(self.groupBox_notifications)
|
||||
self.spin_duration = QtWidgets.QSpinBox(parent=self.groupBox_notifications)
|
||||
self.spin_duration.setMinimum(500)
|
||||
self.spin_duration.setMaximum(30000)
|
||||
self.spin_duration.setSingleStep(100)
|
||||
self.spin_duration.setObjectName("spin_duration")
|
||||
self.gridLayout_4.addWidget(self.spin_duration, 1, 1, 1, 1)
|
||||
self.cb_notification_click = QtWidgets.QCheckBox(self.groupBox_notifications)
|
||||
self.cb_notification_click = QtWidgets.QCheckBox(parent=self.groupBox_notifications)
|
||||
self.cb_notification_click.setObjectName("cb_notification_click")
|
||||
self.gridLayout_4.addWidget(self.cb_notification_click, 3, 0, 1, 3)
|
||||
self.label_notification_duration_ms = QtWidgets.QLabel(self.groupBox_notifications)
|
||||
self.label_notification_duration_ms = QtWidgets.QLabel(parent=self.groupBox_notifications)
|
||||
self.label_notification_duration_ms.setObjectName("label_notification_duration_ms")
|
||||
self.gridLayout_4.addWidget(self.label_notification_duration_ms, 1, 2, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.gridLayout_4.addItem(spacerItem, 0, 2, 1, 1)
|
||||
self.cb_notify = QtWidgets.QCheckBox(self.groupBox_notifications)
|
||||
self.cb_notify = QtWidgets.QCheckBox(parent=self.groupBox_notifications)
|
||||
self.cb_notify.setObjectName("cb_notify")
|
||||
self.gridLayout_4.addWidget(self.cb_notify, 2, 0, 1, 3)
|
||||
self.spin_priority = QtWidgets.QSpinBox(self.groupBox_notifications)
|
||||
self.spin_priority = QtWidgets.QSpinBox(parent=self.groupBox_notifications)
|
||||
self.spin_priority.setMinimum(1)
|
||||
self.spin_priority.setMaximum(10)
|
||||
self.spin_priority.setProperty("value", 5)
|
||||
self.spin_priority.setObjectName("spin_priority")
|
||||
self.gridLayout_4.addWidget(self.spin_priority, 0, 1, 1, 1)
|
||||
self.label_notification_priority = QtWidgets.QLabel(self.groupBox_notifications)
|
||||
self.label_notification_priority = QtWidgets.QLabel(parent=self.groupBox_notifications)
|
||||
self.label_notification_priority.setObjectName("label_notification_priority")
|
||||
self.gridLayout_4.addWidget(self.label_notification_priority, 0, 0, 1, 1)
|
||||
self.cb_tray_icon_unread = QtWidgets.QCheckBox(self.groupBox_notifications)
|
||||
self.cb_tray_icon_unread = QtWidgets.QCheckBox(parent=self.groupBox_notifications)
|
||||
self.cb_tray_icon_unread.setObjectName("cb_tray_icon_unread")
|
||||
self.gridLayout_4.addWidget(self.cb_tray_icon_unread, 4, 0, 1, 3)
|
||||
self.verticalLayout_4.addWidget(self.groupBox_notifications)
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(self.tab_general)
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(parent=self.tab_general)
|
||||
self.groupBox_2.setObjectName("groupBox_2")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.groupBox_2)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.label_theme = QtWidgets.QLabel(self.groupBox_2)
|
||||
self.label_theme.setObjectName("label_theme")
|
||||
self.horizontalLayout_3.addWidget(self.label_theme)
|
||||
self.combo_theme = QtWidgets.QComboBox(self.groupBox_2)
|
||||
self.combo_theme.setObjectName("combo_theme")
|
||||
self.horizontalLayout_3.addWidget(self.combo_theme)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout_3.addItem(spacerItem1)
|
||||
self.verticalLayout_2.addLayout(self.horizontalLayout_3)
|
||||
self.cb_priority_colors = QtWidgets.QCheckBox(self.groupBox_2)
|
||||
self.cb_priority_colors = QtWidgets.QCheckBox(parent=self.groupBox_2)
|
||||
self.cb_priority_colors.setObjectName("cb_priority_colors")
|
||||
self.verticalLayout_2.addWidget(self.cb_priority_colors)
|
||||
self.cb_locale = QtWidgets.QCheckBox(self.groupBox_2)
|
||||
self.cb_locale = QtWidgets.QCheckBox(parent=self.groupBox_2)
|
||||
self.cb_locale.setObjectName("cb_locale")
|
||||
self.verticalLayout_2.addWidget(self.cb_locale)
|
||||
self.verticalLayout_4.addWidget(self.groupBox_2)
|
||||
self.groupBox_server_info = QtWidgets.QGroupBox(self.tab_general)
|
||||
self.groupBox_server_info = QtWidgets.QGroupBox(parent=self.tab_general)
|
||||
self.groupBox_server_info.setObjectName("groupBox_server_info")
|
||||
self.gridLayout_3 = QtWidgets.QGridLayout(self.groupBox_server_info)
|
||||
self.gridLayout_3.setObjectName("gridLayout_3")
|
||||
self.pb_change_server_info = QtWidgets.QPushButton(self.groupBox_server_info)
|
||||
self.pb_change_server_info = QtWidgets.QPushButton(parent=self.groupBox_server_info)
|
||||
self.pb_change_server_info.setObjectName("pb_change_server_info")
|
||||
self.gridLayout_3.addWidget(self.pb_change_server_info, 0, 0, 1, 1)
|
||||
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.gridLayout_3.addItem(spacerItem2, 0, 1, 1, 1)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.gridLayout_3.addItem(spacerItem1, 0, 1, 1, 1)
|
||||
self.verticalLayout_4.addWidget(self.groupBox_server_info)
|
||||
spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.verticalLayout_4.addItem(spacerItem3)
|
||||
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.verticalLayout_4.addItem(spacerItem2)
|
||||
self.tabWidget.addTab(self.tab_general, "")
|
||||
self.tab_fonts = QtWidgets.QWidget()
|
||||
self.tab_fonts.setObjectName("tab_fonts")
|
||||
@@ -104,11 +93,11 @@ class Ui_Dialog(object):
|
||||
self.verticalLayout_5.setObjectName("verticalLayout_5")
|
||||
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||
self.pb_reset_fonts = QtWidgets.QPushButton(self.tab_fonts)
|
||||
self.pb_reset_fonts = QtWidgets.QPushButton(parent=self.tab_fonts)
|
||||
self.pb_reset_fonts.setObjectName("pb_reset_fonts")
|
||||
self.horizontalLayout_5.addWidget(self.pb_reset_fonts)
|
||||
self.verticalLayout_5.addLayout(self.horizontalLayout_5)
|
||||
self.groupBox_fonts_message = QtWidgets.QGroupBox(self.tab_fonts)
|
||||
self.groupBox_fonts_message = QtWidgets.QGroupBox(parent=self.tab_fonts)
|
||||
self.groupBox_fonts_message.setObjectName("groupBox_fonts_message")
|
||||
self.layout_fonts_message = QtWidgets.QVBoxLayout(self.groupBox_fonts_message)
|
||||
self.layout_fonts_message.setContentsMargins(4, 4, 4, 4)
|
||||
@@ -116,102 +105,102 @@ class Ui_Dialog(object):
|
||||
self.layout_fonts_message.setObjectName("layout_fonts_message")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.pb_font_message_title = QtWidgets.QPushButton(self.groupBox_fonts_message)
|
||||
self.pb_font_message_title = QtWidgets.QPushButton(parent=self.groupBox_fonts_message)
|
||||
self.pb_font_message_title.setObjectName("pb_font_message_title")
|
||||
self.horizontalLayout.addWidget(self.pb_font_message_title)
|
||||
self.pb_font_message_date = QtWidgets.QPushButton(self.groupBox_fonts_message)
|
||||
self.pb_font_message_date = QtWidgets.QPushButton(parent=self.groupBox_fonts_message)
|
||||
self.pb_font_message_date.setObjectName("pb_font_message_date")
|
||||
self.horizontalLayout.addWidget(self.pb_font_message_date)
|
||||
self.pb_font_message_content = QtWidgets.QPushButton(self.groupBox_fonts_message)
|
||||
self.pb_font_message_content = QtWidgets.QPushButton(parent=self.groupBox_fonts_message)
|
||||
self.pb_font_message_content.setObjectName("pb_font_message_content")
|
||||
self.horizontalLayout.addWidget(self.pb_font_message_content)
|
||||
self.layout_fonts_message.addLayout(self.horizontalLayout)
|
||||
self.verticalLayout_5.addWidget(self.groupBox_fonts_message)
|
||||
spacerItem4 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.verticalLayout_5.addItem(spacerItem4)
|
||||
spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.verticalLayout_5.addItem(spacerItem3)
|
||||
self.tabWidget.addTab(self.tab_fonts, "")
|
||||
self.tab_advanced = QtWidgets.QWidget()
|
||||
self.tab_advanced.setObjectName("tab_advanced")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.tab_advanced)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.groupBox = QtWidgets.QGroupBox(self.tab_advanced)
|
||||
self.groupBox = QtWidgets.QGroupBox(parent=self.tab_advanced)
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.groupBox)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.pb_reset = QtWidgets.QPushButton(self.groupBox)
|
||||
self.pb_reset = QtWidgets.QPushButton(parent=self.groupBox)
|
||||
self.pb_reset.setObjectName("pb_reset")
|
||||
self.horizontalLayout_2.addWidget(self.pb_reset)
|
||||
self.pb_import = QtWidgets.QPushButton(self.groupBox)
|
||||
self.pb_import = QtWidgets.QPushButton(parent=self.groupBox)
|
||||
self.pb_import.setObjectName("pb_import")
|
||||
self.horizontalLayout_2.addWidget(self.pb_import)
|
||||
self.pb_export = QtWidgets.QPushButton(self.groupBox)
|
||||
self.pb_export = QtWidgets.QPushButton(parent=self.groupBox)
|
||||
self.pb_export.setObjectName("pb_export")
|
||||
self.horizontalLayout_2.addWidget(self.pb_export)
|
||||
self.verticalLayout.addWidget(self.groupBox)
|
||||
self.groupbox_image_popup = QtWidgets.QGroupBox(self.tab_advanced)
|
||||
self.groupbox_image_popup = QtWidgets.QGroupBox(parent=self.tab_advanced)
|
||||
self.groupbox_image_popup.setCheckable(True)
|
||||
self.groupbox_image_popup.setObjectName("groupbox_image_popup")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.groupbox_image_popup)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
self.label = QtWidgets.QLabel(self.groupbox_image_popup)
|
||||
self.label = QtWidgets.QLabel(parent=self.groupbox_image_popup)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout_4.addWidget(self.label)
|
||||
self.spin_popup_w = QtWidgets.QSpinBox(self.groupbox_image_popup)
|
||||
self.spin_popup_w = QtWidgets.QSpinBox(parent=self.groupbox_image_popup)
|
||||
self.spin_popup_w.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
|
||||
self.spin_popup_w.setMinimum(100)
|
||||
self.spin_popup_w.setMaximum(10000)
|
||||
self.spin_popup_w.setObjectName("spin_popup_w")
|
||||
self.horizontalLayout_4.addWidget(self.spin_popup_w)
|
||||
self.label_2 = QtWidgets.QLabel(self.groupbox_image_popup)
|
||||
self.label_2 = QtWidgets.QLabel(parent=self.groupbox_image_popup)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.horizontalLayout_4.addWidget(self.label_2)
|
||||
self.spin_popup_h = QtWidgets.QSpinBox(self.groupbox_image_popup)
|
||||
self.spin_popup_h = QtWidgets.QSpinBox(parent=self.groupbox_image_popup)
|
||||
self.spin_popup_h.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
|
||||
self.spin_popup_h.setMinimum(100)
|
||||
self.spin_popup_h.setMaximum(10000)
|
||||
self.spin_popup_h.setObjectName("spin_popup_h")
|
||||
self.horizontalLayout_4.addWidget(self.spin_popup_h)
|
||||
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout_4.addItem(spacerItem5)
|
||||
spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout_4.addItem(spacerItem4)
|
||||
self.gridLayout_2.addLayout(self.horizontalLayout_4, 0, 0, 1, 1)
|
||||
self.verticalLayout.addWidget(self.groupbox_image_popup)
|
||||
self.groupBox_cache = QtWidgets.QGroupBox(self.tab_advanced)
|
||||
self.groupBox_cache = QtWidgets.QGroupBox(parent=self.tab_advanced)
|
||||
self.groupBox_cache.setObjectName("groupBox_cache")
|
||||
self.horizontalLayout_6 = QtWidgets.QHBoxLayout(self.groupBox_cache)
|
||||
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
|
||||
self.pb_clear_cache = QtWidgets.QPushButton(self.groupBox_cache)
|
||||
self.pb_clear_cache = QtWidgets.QPushButton(parent=self.groupBox_cache)
|
||||
self.pb_clear_cache.setObjectName("pb_clear_cache")
|
||||
self.horizontalLayout_6.addWidget(self.pb_clear_cache)
|
||||
self.pb_open_cache_dir = QtWidgets.QPushButton(self.groupBox_cache)
|
||||
self.pb_open_cache_dir = QtWidgets.QPushButton(parent=self.groupBox_cache)
|
||||
self.pb_open_cache_dir.setObjectName("pb_open_cache_dir")
|
||||
self.horizontalLayout_6.addWidget(self.pb_open_cache_dir)
|
||||
self.label_cache = QtWidgets.QLabel(self.groupBox_cache)
|
||||
self.label_cache = QtWidgets.QLabel(parent=self.groupBox_cache)
|
||||
self.label_cache.setObjectName("label_cache")
|
||||
self.horizontalLayout_6.addWidget(self.label_cache)
|
||||
spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout_6.addItem(spacerItem6)
|
||||
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout_6.addItem(spacerItem5)
|
||||
self.verticalLayout.addWidget(self.groupBox_cache)
|
||||
self.groupBox_logging = QtWidgets.QGroupBox(self.tab_advanced)
|
||||
self.groupBox_logging = QtWidgets.QGroupBox(parent=self.tab_advanced)
|
||||
self.groupBox_logging.setObjectName("groupBox_logging")
|
||||
self.gridLayout_6 = QtWidgets.QGridLayout(self.groupBox_logging)
|
||||
self.gridLayout_6.setObjectName("gridLayout_6")
|
||||
self.combo_logging = QtWidgets.QComboBox(self.groupBox_logging)
|
||||
self.combo_logging = QtWidgets.QComboBox(parent=self.groupBox_logging)
|
||||
self.combo_logging.setObjectName("combo_logging")
|
||||
self.gridLayout_6.addWidget(self.combo_logging, 0, 1, 1, 1)
|
||||
spacerItem7 = QtWidgets.QSpacerItem(190, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.gridLayout_6.addItem(spacerItem7, 0, 3, 1, 1)
|
||||
self.pb_open_log = QtWidgets.QPushButton(self.groupBox_logging)
|
||||
spacerItem6 = QtWidgets.QSpacerItem(190, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.gridLayout_6.addItem(spacerItem6, 0, 3, 1, 1)
|
||||
self.pb_open_log = QtWidgets.QPushButton(parent=self.groupBox_logging)
|
||||
self.pb_open_log.setMaximumSize(QtCore.QSize(30, 16777215))
|
||||
self.pb_open_log.setObjectName("pb_open_log")
|
||||
self.gridLayout_6.addWidget(self.pb_open_log, 0, 2, 1, 1)
|
||||
self.label_logging = QtWidgets.QLabel(self.groupBox_logging)
|
||||
self.label_logging = QtWidgets.QLabel(parent=self.groupBox_logging)
|
||||
self.label_logging.setObjectName("label_logging")
|
||||
self.gridLayout_6.addWidget(self.label_logging, 0, 0, 1, 1)
|
||||
self.verticalLayout.addWidget(self.groupBox_logging)
|
||||
spacerItem8 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.verticalLayout.addItem(spacerItem8)
|
||||
spacerItem7 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.verticalLayout.addItem(spacerItem7)
|
||||
self.tabWidget.addTab(self.tab_advanced, "")
|
||||
self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1)
|
||||
|
||||
@@ -239,7 +228,6 @@ class Ui_Dialog(object):
|
||||
self.label_notification_priority.setText(_translate("Dialog", "Minimum priority to show notifications:"))
|
||||
self.cb_tray_icon_unread.setText(_translate("Dialog", "Change the tray icon color when there are unread notifications"))
|
||||
self.groupBox_2.setTitle(_translate("Dialog", "Interface"))
|
||||
self.label_theme.setText(_translate("Dialog", "Theme:"))
|
||||
self.cb_priority_colors.setToolTip(_translate("Dialog", "4..7 -> medium\n"
|
||||
"8..10 -> high"))
|
||||
self.cb_priority_colors.setText(_translate("Dialog", "Show message priority colors"))
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>415</width>
|
||||
<height>450</height>
|
||||
<height>420</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -130,33 +130,6 @@
|
||||
<string>Interface</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_theme">
|
||||
<property name="text">
|
||||
<string>Theme:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="combo_theme"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cb_priority_colors">
|
||||
<property name="toolTip">
|
||||
|
||||
@@ -1,59 +1,28 @@
|
||||
import logging
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
from gotify_tray.utils import get_abs_path
|
||||
from . import default, dark_purple, light_purple
|
||||
from gotify_tray.database import Settings
|
||||
|
||||
|
||||
settings = Settings("gotify-tray")
|
||||
logger = logging.getLogger("gotify-tray")
|
||||
|
||||
|
||||
themes = {
|
||||
"default": default,
|
||||
"automatic": None,
|
||||
"dark purple": dark_purple,
|
||||
"light purple": light_purple,
|
||||
QtCore.Qt.ColorScheme.Dark: "dark",
|
||||
QtCore.Qt.ColorScheme.Light: "light",
|
||||
QtCore.Qt.ColorScheme.Unknown: "light",
|
||||
}
|
||||
|
||||
|
||||
def get_themes():
|
||||
return themes.keys()
|
||||
|
||||
|
||||
def is_dark_mode(app: QtWidgets.QApplication) -> bool:
|
||||
return app.styleHints().colorScheme() == QtCore.Qt.ColorScheme.Dark
|
||||
|
||||
|
||||
def is_valid_theme(theme: str) -> bool:
|
||||
return theme in get_themes()
|
||||
|
||||
|
||||
def set_theme(app: QtWidgets.QApplication, theme: str = "automatic"):
|
||||
if not is_valid_theme(theme):
|
||||
logger.warning(f"set_theme: theme {theme} is unsupported.")
|
||||
theme = "automatic"
|
||||
|
||||
if theme == "automatic":
|
||||
theme = "dark purple" if is_dark_mode(app) else "light purple"
|
||||
def set_theme(app: QtWidgets.QApplication):
|
||||
theme = themes.get(app.styleHints().colorScheme(), "light")
|
||||
|
||||
stylesheet = ""
|
||||
with open(get_abs_path(f"gotify_tray/gui/themes/{theme.replace(' ', '_')}/style.qss"), "r") as f:
|
||||
with open(get_abs_path(f"gotify_tray/gui/themes/base.qss"), "r") as f:
|
||||
stylesheet += f.read()
|
||||
with open(get_abs_path(f"gotify_tray/gui/themes/{theme}/style.qss"), "r") as f:
|
||||
stylesheet += f.read()
|
||||
|
||||
app.setPalette(themes[theme].get_palette())
|
||||
app.setPalette(QtGui.QPalette())
|
||||
app.setStyleSheet(stylesheet)
|
||||
|
||||
|
||||
def get_theme_file(file: str, theme: str | None = None) -> str:
|
||||
theme = settings.value("theme", type=str) if not theme else theme
|
||||
|
||||
if not is_valid_theme(theme):
|
||||
logger.warning(f"set_theme: theme {theme} is unsupported.")
|
||||
theme = "automatic"
|
||||
|
||||
if theme in ("automatic", "default"):
|
||||
app = QtCore.QCoreApplication.instance()
|
||||
theme = "dark purple" if is_dark_mode(app) else "light purple"
|
||||
|
||||
return get_abs_path(f"gotify_tray/gui/themes/{theme.replace(' ', '_')}/{file}")
|
||||
def get_theme_file(file: str) -> str:
|
||||
app = QtCore.QCoreApplication.instance()
|
||||
theme = themes.get(app.styleHints().colorScheme(), "light")
|
||||
return get_abs_path(f"gotify_tray/gui/themes/{theme}/{file}")
|
||||
|
||||
7
gotify_tray/gui/themes/base.qss
Normal file
@@ -0,0 +1,7 @@
|
||||
MessageWidget QPushButton[objectName^="pb_delete"] {
|
||||
qproperty-iconSize: 24px;
|
||||
}
|
||||
|
||||
MessageWidget QLabel[objectName^="label_date"] {
|
||||
margin-right: 1px;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
23
gotify_tray/gui/themes/dark/style.qss
Normal file
@@ -0,0 +1,23 @@
|
||||
ServerInfoDialog QPushButton[state="success"] {
|
||||
background-color: #960b7a0b;
|
||||
color: white;
|
||||
}
|
||||
|
||||
ServerInfoDialog QPushButton[state="success"]:!default:hover {
|
||||
background: #960b7a0b;
|
||||
}
|
||||
|
||||
ServerInfoDialog QPushButton[state="failed"] {
|
||||
background-color: #8ebb2929;
|
||||
color: white;
|
||||
}
|
||||
|
||||
ServerInfoDialog QPushButton[state="failed"]:!default:hover {
|
||||
background: #8ebb2929;
|
||||
}
|
||||
|
||||
ServerInfoDialog QLineEdit[state="success"] {}
|
||||
|
||||
ServerInfoDialog QLineEdit[state="failed"] {
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 170 B After Width: | Height: | Size: 170 B |
@@ -1 +0,0 @@
|
||||
from .palette import get_palette
|
||||
@@ -1,65 +0,0 @@
|
||||
from PyQt6 import QtGui
|
||||
|
||||
|
||||
def get_palette() -> QtGui.QPalette:
|
||||
palette = QtGui.QPalette()
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, QtGui.QColor(0x2E2E30))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, QtGui.QColor(0x2E2E30))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, QtGui.QColor(0x424242))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, QtGui.QColor(0xCACBCE))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, QtGui.QColor(0xC8C8C6))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, QtGui.QColor(0x707070))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, QtGui.QColor(0xCACBCE))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, QtGui.QColor(0xC8C8C6))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, QtGui.QColor(0x707070))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.PlaceholderText, QtGui.QColor(0x7D7D82))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.PlaceholderText, QtGui.QColor(0x87888C))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.PlaceholderText, QtGui.QColor(0x737373))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, QtGui.QColor(0x252627))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, QtGui.QColor(0x2E2E30))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, QtGui.QColor(0x333333))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, QtGui.QColor(0x27272A))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, QtGui.QColor(0x27272A))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, QtGui.QColor(0x343437))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, QtGui.QColor(0x2C2C30))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, QtGui.QColor(0x2B2B2F))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, QtGui.QColor(0x36363A))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.All, QtGui.QPalette.ColorRole.ToolTipBase, QtGui.QColor(0x5522a8))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.All, QtGui.QPalette.ColorRole.ToolTipText, QtGui.QColor(0xBFBFBF))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, QtGui.QColor(0x222223))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, QtGui.QColor(0x222223))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, QtGui.QColor(0x2B2A2A))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, QtGui.QColor(0xB9B9BE))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, QtGui.QColor(0x9E9FA5))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, QtGui.QColor(0x73747E))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Highlight, QtGui.QColor(0x6D29DC))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Highlight, QtGui.QColor(0x5522a8))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Highlight, QtGui.QColor(0x5522a8))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.HighlightedText, QtGui.QColor(0xCCCCCC))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.HighlightedText, QtGui.QColor(0xCECECE))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.HighlightedText, QtGui.QColor(0x707070))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.All, QtGui.QPalette.ColorRole.Light, QtGui.QColor(0x414145))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.All, QtGui.QPalette.ColorRole.Midlight, QtGui.QColor(0x39393C))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.All, QtGui.QPalette.ColorRole.Mid, QtGui.QColor(0x2F2F32))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.All, QtGui.QPalette.ColorRole.Dark, QtGui.QColor(0x202022))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.All, QtGui.QPalette.ColorRole.Shadow, QtGui.QColor(0x19191A))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.All, QtGui.QPalette.ColorRole.Link, QtGui.QColor(0xAE7AFF))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Link, QtGui.QColor(0xAE7AFF))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.All, QtGui.QPalette.ColorRole.LinkVisited, QtGui.QColor(0x5522a8))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.LinkVisited, QtGui.QColor(0x6D29DC))
|
||||
|
||||
return palette
|
||||
@@ -1,60 +0,0 @@
|
||||
QPushButton:!default:hover {
|
||||
background: #441b85;
|
||||
}
|
||||
|
||||
QPushButton:default:hover, QPushButton:checked:hover {
|
||||
background: #441b85;
|
||||
}
|
||||
|
||||
ServerInfoDialog QPushButton[state="success"] {
|
||||
background-color: #960b7a0b;
|
||||
color: white;
|
||||
}
|
||||
|
||||
ServerInfoDialog QPushButton[state="success"]:!default:hover {
|
||||
background: #960b7a0b;
|
||||
}
|
||||
|
||||
ServerInfoDialog QPushButton[state="failed"] {
|
||||
background-color: #8ebb2929;
|
||||
color: white;
|
||||
}
|
||||
|
||||
ServerInfoDialog QPushButton[state="failed"]:!default:hover {
|
||||
background: #8ebb2929;
|
||||
}
|
||||
|
||||
ServerInfoDialog QLineEdit[state="success"] {}
|
||||
|
||||
ServerInfoDialog QLineEdit[state="failed"] {
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
||||
QToolTip {
|
||||
color: #BFBFBF;
|
||||
background-color: #5522a8;
|
||||
}
|
||||
|
||||
QListView[objectName^="listView_applications"] {
|
||||
background-color: #2E2E30;
|
||||
}
|
||||
|
||||
MessageWidget QFrame {
|
||||
background-color: #2E2E30;
|
||||
}
|
||||
|
||||
MessageWidget QPushButton {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
MessageWidget QPushButton:!default:hover {
|
||||
background: #7249b5;
|
||||
}
|
||||
|
||||
MessageWidget QPushButton:!default:pressed {
|
||||
background: #5c3b91;
|
||||
}
|
||||
|
||||
QCheckBox::indicator:unchecked {
|
||||
border: 2px solid #4A4A4A;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
from .palette import get_palette
|
||||
@@ -1,7 +0,0 @@
|
||||
from PyQt6 import QtGui
|
||||
|
||||
|
||||
def get_palette() -> QtGui.QPalette:
|
||||
palette = QtGui.QPalette()
|
||||
|
||||
return palette
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@@ -1,11 +1,3 @@
|
||||
QPushButton:!default:hover {
|
||||
background: #5c24b6;
|
||||
}
|
||||
|
||||
QPushButton:default:hover, QPushButton:checked:hover {
|
||||
background: #5c24b6;
|
||||
}
|
||||
|
||||
ServerInfoDialog QPushButton[state="success"] {
|
||||
background-color: #6400FF00;
|
||||
color: black;
|
||||
@@ -29,20 +21,3 @@ ServerInfoDialog QLineEdit[state="success"] {}
|
||||
ServerInfoDialog QLineEdit[state="failed"] {
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
||||
QToolTip {
|
||||
color: #BFBFBF;
|
||||
background-color: #5522a8;
|
||||
}
|
||||
|
||||
MessageWidget QPushButton {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
MessageWidget QPushButton:!default:hover {
|
||||
background: #9662ea;
|
||||
}
|
||||
|
||||
MessageWidget QPushButton:!default:pressed {
|
||||
background: #7a4dc2;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 155 B After Width: | Height: | Size: 155 B |
@@ -1 +0,0 @@
|
||||
from .palette import get_palette
|
||||
@@ -1,61 +0,0 @@
|
||||
from PyQt6 import QtGui
|
||||
|
||||
|
||||
def get_palette() -> QtGui.QPalette:
|
||||
palette = QtGui.QPalette()
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, QtGui.QColor(0xF7F7F7))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, QtGui.QColor(0xFCFCFC))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, QtGui.QColor(0xEDEDED))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, QtGui.QColor(0x1D1D20))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, QtGui.QColor(0x252528))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, QtGui.QColor(0x8C8C92))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, QtGui.QColor(0x1D1D20))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, QtGui.QColor(0x252528))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, QtGui.QColor(0x8C8C92))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.PlaceholderText, QtGui.QColor(0x71727D))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.PlaceholderText, QtGui.QColor(0x878893))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.PlaceholderText, QtGui.QColor(0xA3A4AC))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, QtGui.QColor(0xF3F3F4))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, QtGui.QColor(0xEAEAEB))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, QtGui.QColor(0xE4E5E7))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, QtGui.QColor(0xF9F9F9))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, QtGui.QColor(0xFCFCFC))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, QtGui.QColor(0xEFEFF2))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, QtGui.QColor(0xECF3E8))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, QtGui.QColor(0xF1F6EE))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, QtGui.QColor(0xE1E9DD))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.All, QtGui.QPalette.ColorRole.ToolTipBase, QtGui.QColor(0x5522a8))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.All, QtGui.QPalette.ColorRole.ToolTipText, QtGui.QColor(0xBFBFBF))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, QtGui.QColor(0x181A18))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, QtGui.QColor(0x454A54))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, QtGui.QColor(0x97979B))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Highlight, QtGui.QColor(0x6D29DC))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Highlight, QtGui.QColor(0x5522a8))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Highlight, QtGui.QColor(0x5522a8))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.HighlightedText, QtGui.QColor(0xCCCCCC))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.HighlightedText, QtGui.QColor(0xCECECE))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.HighlightedText, QtGui.QColor(0x707070))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.All, QtGui.QPalette.ColorRole.Light, QtGui.QColor(0xF9F9F9))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.All, QtGui.QPalette.ColorRole.Midlight, QtGui.QColor(0xE9E9EB))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.All, QtGui.QPalette.ColorRole.Mid, QtGui.QColor(0xC9C9CF))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.All, QtGui.QPalette.ColorRole.Dark, QtGui.QColor(0xBBBBC2))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.All, QtGui.QPalette.ColorRole.Shadow, QtGui.QColor(0x6C6D79))
|
||||
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.All, QtGui.QPalette.ColorRole.Link, QtGui.QColor(0x723BC4))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Link, QtGui.QColor(0x723BC4))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.All, QtGui.QPalette.ColorRole.LinkVisited, QtGui.QColor(0x5522a8))
|
||||
palette.setColor(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.LinkVisited, QtGui.QColor(0x6D29DC))
|
||||
|
||||
return palette
|
||||
@@ -101,7 +101,6 @@ class MessageWidget(QtWidgets.QWidget, Ui_Form):
|
||||
|
||||
def set_icons(self):
|
||||
self.pb_delete.setIcon(QtGui.QIcon(get_theme_file("trashcan.svg")))
|
||||
self.pb_delete.setIconSize(QtCore.QSize(24, 24))
|
||||
|
||||
def set_message_image(self, filename: str):
|
||||
pixmap = QtGui.QPixmap(filename)
|
||||
|
||||
@@ -13,7 +13,6 @@ from gotify_tray.tasks import (
|
||||
CacheSizeTask,
|
||||
ClearCacheTask,
|
||||
)
|
||||
from gotify_tray.gui.themes import get_themes
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from ..designs.widget_settings import Ui_Dialog
|
||||
@@ -25,7 +24,6 @@ settings = Settings("gotify-tray")
|
||||
|
||||
class SettingsDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
quit_requested = QtCore.pyqtSignal()
|
||||
theme_change_requested = QtCore.pyqtSignal(str)
|
||||
|
||||
def __init__(self):
|
||||
super(SettingsDialog, self).__init__()
|
||||
@@ -60,8 +58,6 @@ class SettingsDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
self.cb_tray_icon_unread.setChecked(settings.value("tray/icon/unread", type=bool))
|
||||
|
||||
# Interface
|
||||
self.combo_theme.addItems(get_themes())
|
||||
self.combo_theme.setCurrentText(settings.value("theme", type=str))
|
||||
self.cb_priority_colors.setChecked(settings.value("MessageWidget/priority_color", type=bool))
|
||||
self.cb_locale.setChecked(settings.value("locale", type=bool))
|
||||
|
||||
@@ -193,7 +189,6 @@ class SettingsDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
self.cb_tray_icon_unread.stateChanged.connect(self.settings_changed_callback)
|
||||
|
||||
# Interface
|
||||
self.combo_theme.currentTextChanged.connect(self.settings_changed_callback)
|
||||
self.cb_priority_colors.stateChanged.connect(self.settings_changed_callback)
|
||||
self.cb_locale.stateChanged.connect(self.settings_changed_callback)
|
||||
|
||||
@@ -230,12 +225,6 @@ class SettingsDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
settings.setValue("tray/icon/unread", self.cb_tray_icon_unread.isChecked())
|
||||
|
||||
# Interface
|
||||
current_theme = settings.value("theme", type=str)
|
||||
selected_theme = self.combo_theme.currentText()
|
||||
if current_theme != selected_theme:
|
||||
settings.setValue("theme", selected_theme)
|
||||
self.theme_change_requested.emit(selected_theme)
|
||||
|
||||
settings.setValue("MessageWidget/priority_color", self.cb_priority_colors.isChecked())
|
||||
settings.setValue("locale", self.cb_locale.isChecked())
|
||||
|
||||
|
||||