Automatic theme (#29)

* add "automatic" theme

set the theme and icons based on the system theme

* update the default icons based on system theme

* update pyqt to 6.5.0 to get the colorSchemeChanged callback

* rename style to theme

* remove unused svg files for default theme

* ServerInfoDialog: update feedback colors in dark mode
This commit is contained in:
seird
2023-05-21 11:41:01 +02:00
committed by GitHub
parent 34d81ef6d0
commit bc221d6c8f
17 changed files with 105 additions and 272 deletions

View File

@@ -76,7 +76,7 @@ class MainApplication(QtWidgets.QApplication):
self.messages_model = MessagesModel()
self.application_model = ApplicationModel()
self.main_window = MainWindow(self.application_model, self.messages_model)
self.main_window = MainWindow(self, self.application_model, self.messages_model)
self.main_window.show() # The initial .show() is necessary to get the correct sizes when adding MessageWigets
QtCore.QTimer.singleShot(0, self.main_window.hide)
@@ -381,7 +381,7 @@ class MainApplication(QtWidgets.QApplication):
message_widget.set_icons()
def settings_callback(self):
settings_dialog = SettingsDialog()
settings_dialog = SettingsDialog(self)
settings_dialog.quit_requested.connect(self.quit)
settings_dialog.theme_change_requested.connect(
self.theme_change_requested_callback
@@ -435,6 +435,8 @@ class MainApplication(QtWidgets.QApplication):
self.main_window.image_popup.connect(self.image_popup_callback)
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.watchdog.closed.connect(lambda: self.listener_closed_callback(None, None))