From 138135b9e9e871fd46be06cafd6593100be32345 Mon Sep 17 00:00:00 2001 From: SHooZ Date: Tue, 2 May 2017 02:59:24 +0300 Subject: [PATCH 1/4] Add ability to change theme --- MANIFEST.in | 4 ++-- toxygen/main.py | 15 ++++++++++----- toxygen/menu.py | 15 +++++++++++---- toxygen/settings.py | 9 ++++++++- toxygen/styles/{style.qss => dark_style.qss} | 0 toxygen/styles/style.qrc | 2 +- 6 files changed, 32 insertions(+), 13 deletions(-) rename toxygen/styles/{style.qss => dark_style.qss} (100%) diff --git a/MANIFEST.in b/MANIFEST.in index 9bf65b8..a4e17a3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -12,9 +12,9 @@ include toxygen/smileys/starwars/*.png include toxygen/smileys/starwars/config.json include toxygen/smileys/ksk/*.png include toxygen/smileys/ksk/config.json -include toxygen/styles/style.qss +include toxygen/styles/*.qss include toxygen/translations/*.qm include toxygen/libs/libtox.dll include toxygen/libs/libsodium.a include toxygen/libs/libtox64.dll -include toxygen/libs/libsodium64.a \ No newline at end of file +include toxygen/libs/libsodium64.a diff --git a/toxygen/main.py b/toxygen/main.py index c9ab9cf..ea858d4 100644 --- a/toxygen/main.py +++ b/toxygen/main.py @@ -59,11 +59,6 @@ class Toxygen: if platform.system() == 'Linux': QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_X11InitThreads) - # application color scheme - with open(curr_directory() + '/styles/style.qss') as fl: - dark_style = fl.read() - app.setStyleSheet(dark_style) - encrypt_save = toxes.ToxES() if self.path is not None: @@ -185,6 +180,16 @@ class Toxygen: else: settings.set_active_profile() + # application color scheme + for theme in settings.built_in_themes().keys(): + if settings['theme'] == theme: + try: + with open(curr_directory() + settings.built_in_themes()[theme]) as fl: + style = fl.read() + app.setStyleSheet(style) + except IsADirectoryError: + app.setStyleSheet('') # for default style + lang = Settings.supported_languages()[settings['language']] translator = QtCore.QTranslator() translator.load(curr_directory() + '/translations/' + lang) diff --git a/toxygen/menu.py b/toxygen/menu.py index 1fe22cb..8488578 100644 --- a/toxygen/menu.py +++ b/toxygen/menu.py @@ -581,11 +581,10 @@ class InterfaceSettings(CenteredWidget): self.label.setFont(font) self.themeSelect = QtGui.QComboBox(self) self.themeSelect.setGeometry(QtCore.QRect(30, 40, 120, 30)) - list_of_themes = ['dark'] - self.themeSelect.addItems(list_of_themes) + self.themeSelect.addItems(list(settings.built_in_themes().keys())) theme = settings['theme'] - if theme in list_of_themes: - index = list_of_themes.index(theme) + if theme in settings.built_in_themes().keys(): + index = list(settings.built_in_themes().keys()).index(theme) else: index = 0 self.themeSelect.setCurrentIndex(index) @@ -726,6 +725,14 @@ class InterfaceSettings(CenteredWidget): def closeEvent(self, event): settings = Settings.get_instance() settings['theme'] = str(self.themeSelect.currentText()) + try: + theme = settings['theme'] + app = QtGui.QApplication.instance() + with open(curr_directory() + settings.built_in_themes()[theme]) as fl: + style = fl.read() + app.setStyleSheet(style) + except IsADirectoryError: + app.setStyleSheet('') # for default style settings['smileys'] = self.smileys.isChecked() restart = False if settings['mirror_mode'] != self.mirror_mode.isChecked(): diff --git a/toxygen/settings.py b/toxygen/settings.py index 5fdca64..ca15d3e 100644 --- a/toxygen/settings.py +++ b/toxygen/settings.py @@ -99,7 +99,7 @@ class Settings(dict, Singleton): Default profile settings """ return { - 'theme': 'default', + 'theme': 'dark', 'ipv6_enabled': True, 'udp_enabled': True, 'proxy_type': 0, @@ -152,6 +152,13 @@ class Settings(dict, Singleton): 'Ukrainian': 'uk_UA' } + @staticmethod + def built_in_themes(): + return { + 'dark': '/styles/dark_style.qss', + 'default': '' + } + def upgrade(self): default = Settings.get_default_settings() for key in default: diff --git a/toxygen/styles/style.qss b/toxygen/styles/dark_style.qss similarity index 100% rename from toxygen/styles/style.qss rename to toxygen/styles/dark_style.qss diff --git a/toxygen/styles/style.qrc b/toxygen/styles/style.qrc index ac14bc5..9759a62 100644 --- a/toxygen/styles/style.qrc +++ b/toxygen/styles/style.qrc @@ -41,6 +41,6 @@ rc/radio_unchecked.png - style.qss + dark_style.qss From 9118e0177541b4b7f63386ea4ff8512f81c6746b Mon Sep 17 00:00:00 2001 From: SHooZ Date: Tue, 2 May 2017 20:59:27 +0300 Subject: [PATCH 2/4] Set dark style as default in load screen --- toxygen/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/toxygen/main.py b/toxygen/main.py index ea858d4..8d2cee9 100644 --- a/toxygen/main.py +++ b/toxygen/main.py @@ -59,6 +59,10 @@ class Toxygen: if platform.system() == 'Linux': QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_X11InitThreads) + with open(curr_directory() + '/styles/dark_style.qss') as fl: + style = fl.read() + app.setStyleSheet(style) + encrypt_save = toxes.ToxES() if self.path is not None: From 89caef69056ef52545bf92da2888609eecf52d6a Mon Sep 17 00:00:00 2001 From: SHooZ Date: Wed, 3 May 2017 18:43:22 +0300 Subject: [PATCH 3/4] Edit default avatar image for light themes compatibility --- toxygen/images/avatar.png | Bin 4013 -> 5848 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/toxygen/images/avatar.png b/toxygen/images/avatar.png index 91d12009d026a8eed973cf9c82e7f951b452842c..83ac75787a06d910f1180218eecfd2125ffa70d4 100755 GIT binary patch delta 5827 zcmV;!7Ch;#AJ{FBBoPE>K}|sb0I`n?{9y$E017&hIvamTiJg{rR8-d%htIutdZEoQ z6e&aRy$v9}H>uJ@VVD_UC<6{NG_fI~0ue<-1QkJoA_k0xBC#Thg@9ne9*`iQ#9$Or zQF$}6R&?d%y_c8YA7_1QpS|}zXYYO1x&V;8{kgn!SPFnNo`4_XT^B0GzjoyKE}SbXLTb{bpEJtE$k zCFF=0@fUGX7MGJP;#(rtOckbaMf_GAo5o>g0)T%aiR}UoD@nwrA|~;}Lfk~W6aXA4 z@hgu1iUph;f%sBx=^43vZeo&vuFKM+o7vhj=-!;{RE|Jk6vSkuF!^k{TY6dsla~v? z;+;QBMqFFEsL0l4w$|20=Ei1U73#lk{!NK{yGXBsKlcox^?kAZm0x;20E}5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-m&*@W5b_i8>Cd0``Dwt_ zmYbaKkos~hmoMOdd0`?+7?}s|1llWj@a^Vf(J8s Date: Wed, 3 May 2017 19:42:37 +0300 Subject: [PATCH 4/4] Add padding for search field and contacts nicknames in default theme --- toxygen/main.py | 9 +++------ toxygen/settings.py | 2 +- toxygen/styles/style.qrc | 3 +++ toxygen/styles/style.qss | 4 ++++ 4 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 toxygen/styles/style.qss diff --git a/toxygen/main.py b/toxygen/main.py index 8d2cee9..44e6cbe 100644 --- a/toxygen/main.py +++ b/toxygen/main.py @@ -187,12 +187,9 @@ class Toxygen: # application color scheme for theme in settings.built_in_themes().keys(): if settings['theme'] == theme: - try: - with open(curr_directory() + settings.built_in_themes()[theme]) as fl: - style = fl.read() - app.setStyleSheet(style) - except IsADirectoryError: - app.setStyleSheet('') # for default style + with open(curr_directory() + settings.built_in_themes()[theme]) as fl: + style = fl.read() + app.setStyleSheet(style) lang = Settings.supported_languages()[settings['language']] translator = QtCore.QTranslator() diff --git a/toxygen/settings.py b/toxygen/settings.py index ca15d3e..6edce36 100644 --- a/toxygen/settings.py +++ b/toxygen/settings.py @@ -156,7 +156,7 @@ class Settings(dict, Singleton): def built_in_themes(): return { 'dark': '/styles/dark_style.qss', - 'default': '' + 'default': '/styles/style.qss' } def upgrade(self): diff --git a/toxygen/styles/style.qrc b/toxygen/styles/style.qrc index 9759a62..7ceed90 100644 --- a/toxygen/styles/style.qrc +++ b/toxygen/styles/style.qrc @@ -43,4 +43,7 @@ dark_style.qss + + style.qss + diff --git a/toxygen/styles/style.qss b/toxygen/styles/style.qss new file mode 100644 index 0000000..11beeb5 --- /dev/null +++ b/toxygen/styles/style.qss @@ -0,0 +1,4 @@ +#contact_name +{ + padding-left: 22px; +}