remove themes
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
DEFAULT_SETTINGS = {
|
||||
"logging/level": "Disabled",
|
||||
"MainApplication/theme": "default",
|
||||
"tray/notifications/enabled": True,
|
||||
"tray/notifications/priority": 5,
|
||||
"tray/notifications/duration_ms": 5000,
|
||||
|
||||
@@ -19,7 +19,6 @@ from .ApplicationModel import (
|
||||
ApplicationModelItem,
|
||||
)
|
||||
from .SettingsDialog import SettingsDialog
|
||||
from .themes import set_theme
|
||||
from .Tray import Tray
|
||||
|
||||
settings = Settings("gotify-tray")
|
||||
@@ -65,8 +64,6 @@ class MainApplication(QtWidgets.QApplication):
|
||||
settings.value("Server/client_token", type=str),
|
||||
)
|
||||
|
||||
set_theme(self, settings.value("MainApplication/theme", type=str))
|
||||
|
||||
self.application_model = ApplicationModel()
|
||||
self.refresh_applications()
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ from gotify_tray.utils import verify_server
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from .designs.widget_settings import Ui_Dialog
|
||||
from .themes import set_theme
|
||||
|
||||
|
||||
logger = logging.getLogger("gotify-tray")
|
||||
@@ -34,12 +33,6 @@ class SettingsDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Apply
|
||||
).setEnabled(False)
|
||||
|
||||
# Theme
|
||||
self.combo_theme.addItems(["default", "dark"])
|
||||
self.combo_theme.setCurrentText(
|
||||
settings.value("MainApplication/theme", type=str)
|
||||
)
|
||||
|
||||
# Icons
|
||||
self.cb_icons_notification.setChecked(
|
||||
settings.value("tray/notifications/icon/show", type=bool)
|
||||
@@ -92,9 +85,6 @@ class SettingsDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Apply
|
||||
).clicked.connect(self.apply_settings)
|
||||
|
||||
# Theme
|
||||
self.combo_theme.currentTextChanged.connect(self.settings_changed_callback)
|
||||
|
||||
# Icons
|
||||
self.cb_icons_notification.stateChanged.connect(self.settings_changed_callback)
|
||||
|
||||
@@ -112,10 +102,6 @@ class SettingsDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
)
|
||||
|
||||
def apply_settings(self):
|
||||
# Theme
|
||||
settings.setValue("MainApplication/theme", self.combo_theme.currentText())
|
||||
set_theme(self.app, self.combo_theme.currentText())
|
||||
|
||||
# Icons
|
||||
settings.setValue(
|
||||
"tray/notifications/icon/show", self.cb_icons_notification.isChecked()
|
||||
|
||||
@@ -12,19 +12,9 @@ from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(375, 392)
|
||||
Dialog.resize(375, 328)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.groupBox_6 = QtWidgets.QGroupBox(Dialog)
|
||||
self.groupBox_6.setObjectName("groupBox_6")
|
||||
self.gridLayout_5 = QtWidgets.QGridLayout(self.groupBox_6)
|
||||
self.gridLayout_5.setObjectName("gridLayout_5")
|
||||
self.combo_theme = QtWidgets.QComboBox(self.groupBox_6)
|
||||
self.combo_theme.setObjectName("combo_theme")
|
||||
self.gridLayout_5.addWidget(self.combo_theme, 0, 0, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.gridLayout_5.addItem(spacerItem, 0, 1, 1, 1)
|
||||
self.verticalLayout.addWidget(self.groupBox_6)
|
||||
self.groupBox_3 = QtWidgets.QGroupBox(Dialog)
|
||||
self.groupBox_3.setObjectName("groupBox_3")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.groupBox_3)
|
||||
@@ -43,8 +33,8 @@ class Ui_Dialog(object):
|
||||
self.spin_priority.setProperty("value", 5)
|
||||
self.spin_priority.setObjectName("spin_priority")
|
||||
self.gridLayout_4.addWidget(self.spin_priority, 0, 1, 1, 1)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.gridLayout_4.addItem(spacerItem1, 0, 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.label_4 = QtWidgets.QLabel(self.groupBox_5)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.gridLayout_4.addWidget(self.label_4, 0, 0, 1, 1)
|
||||
@@ -68,8 +58,8 @@ class Ui_Dialog(object):
|
||||
self.pb_change_server_info = QtWidgets.QPushButton(self.groupBox_4)
|
||||
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.addWidget(self.groupBox_4)
|
||||
self.groupBox_7 = QtWidgets.QGroupBox(Dialog)
|
||||
self.groupBox_7.setObjectName("groupBox_7")
|
||||
@@ -85,8 +75,8 @@ class Ui_Dialog(object):
|
||||
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)
|
||||
spacerItem3 = QtWidgets.QSpacerItem(190, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.gridLayout_6.addItem(spacerItem3, 0, 3, 1, 1)
|
||||
spacerItem2 = QtWidgets.QSpacerItem(190, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.gridLayout_6.addItem(spacerItem2, 0, 3, 1, 1)
|
||||
self.verticalLayout.addWidget(self.groupBox_7)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
@@ -98,7 +88,6 @@ class Ui_Dialog(object):
|
||||
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
|
||||
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
Dialog.setTabOrder(self.combo_theme, self.cb_icons_notification)
|
||||
Dialog.setTabOrder(self.cb_icons_notification, self.spin_priority)
|
||||
Dialog.setTabOrder(self.spin_priority, self.spin_duration)
|
||||
Dialog.setTabOrder(self.spin_duration, self.pb_change_server_info)
|
||||
@@ -108,7 +97,6 @@ class Ui_Dialog(object):
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
|
||||
self.groupBox_6.setTitle(_translate("Dialog", "Theme"))
|
||||
self.groupBox_3.setTitle(_translate("Dialog", "Icons"))
|
||||
self.cb_icons_notification.setText(_translate("Dialog", "Show notification icons"))
|
||||
self.groupBox_5.setTitle(_translate("Dialog", "Notifications"))
|
||||
|
||||
@@ -7,38 +7,13 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>375</width>
|
||||
<height>392</height>
|
||||
<height>328</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_6">
|
||||
<property name="title">
|
||||
<string>Theme</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="QComboBox" name="combo_theme"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<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>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
@@ -214,7 +189,6 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>combo_theme</tabstop>
|
||||
<tabstop>cb_icons_notification</tabstop>
|
||||
<tabstop>spin_priority</tabstop>
|
||||
<tabstop>spin_duration</tabstop>
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
from PyQt6 import QtWidgets
|
||||
|
||||
|
||||
def set_theme(app: QtWidgets.QApplication, theme: str = "default"):
|
||||
if theme == "default":
|
||||
from . import default
|
||||
|
||||
app.setPalette(default.palette())
|
||||
elif theme == "dark":
|
||||
from . import dark
|
||||
|
||||
app.setPalette(dark.palette())
|
||||
@@ -1,19 +0,0 @@
|
||||
from PyQt6 import QtCore, QtGui
|
||||
|
||||
|
||||
def palette() -> QtGui.QPalette:
|
||||
palette = QtGui.QPalette()
|
||||
palette.setColor(QtGui.QPalette.ColorRole.Window, QtGui.QColor(44, 44, 44))
|
||||
palette.setColor(QtGui.QPalette.ColorRole.WindowText, QtCore.Qt.GlobalColor.white)
|
||||
palette.setColor(QtGui.QPalette.ColorRole.Base, QtGui.QColor(52, 52, 52))
|
||||
palette.setColor(QtGui.QPalette.ColorRole.AlternateBase, QtGui.QColor(44, 44, 44))
|
||||
palette.setColor(QtGui.QPalette.ColorRole.ToolTipBase, QtCore.Qt.GlobalColor.white)
|
||||
palette.setColor(QtGui.QPalette.ColorRole.ToolTipText, QtCore.Qt.GlobalColor.white)
|
||||
palette.setColor(QtGui.QPalette.ColorRole.Text, QtCore.Qt.GlobalColor.white)
|
||||
palette.setColor(QtGui.QPalette.ColorRole.Button, QtGui.QColor(44, 44, 44))
|
||||
palette.setColor(QtGui.QPalette.ColorRole.ButtonText, QtCore.Qt.GlobalColor.white)
|
||||
palette.setColor(QtGui.QPalette.ColorRole.BrightText, QtCore.Qt.GlobalColor.red)
|
||||
palette.setColor(QtGui.QPalette.ColorRole.Link, QtGui.QColor(198, 99, 255))
|
||||
palette.setColor(QtGui.QPalette.ColorRole.Highlight, QtGui.QColor(198, 99, 255))
|
||||
palette.setColor(QtGui.QPalette.ColorRole.HighlightedText, QtCore.Qt.GlobalColor.black)
|
||||
return palette
|
||||
@@ -1,6 +0,0 @@
|
||||
from PyQt6 import QtGui
|
||||
|
||||
|
||||
def palette() -> QtGui.QPalette:
|
||||
palette = QtGui.QPalette()
|
||||
return palette
|
||||
Reference in New Issue
Block a user