From ddce1519a4b206dd20f9a97706381a0bd05af22a Mon Sep 17 00:00:00 2001 From: alessandro90 Date: Sat, 18 May 2019 21:37:57 +0200 Subject: [PATCH] Add support for multiple modulations and locations per signal. Also remove numbers from theme folders and order the themes appearence in action menu --- artemis.py | 26 ++++++++------ themes/{1-dark => dark}/colors.txt | 0 themes/{1-dark => dark}/dark.qss | 34 +++++++++--------- themes/{1-dark => dark}/icons/down-arrow.png | Bin .../icons/down-arrow_hover.png | Bin .../{1-dark => dark}/icons/down-arrow_off.png | Bin themes/{1-dark => dark}/icons/off.png | Bin themes/{1-dark => dark}/icons/off_press.png | Bin themes/{1-dark => dark}/icons/on.png | Bin themes/{1-dark => dark}/icons/on_press.png | Bin themes/{1-dark => dark}/icons/search_icon.png | Bin themes/{1-dark => dark}/icons/up-arrow.png | Bin .../{1-dark => dark}/icons/up-arrow_hover.png | Bin .../{1-dark => dark}/icons/up-arrow_off.png | Bin themes/{1-dark => dark}/icons/volume.png | Bin .../colors.txt | 0 .../icons/down-arrow.png | Bin .../icons/down-arrow_hover.png | Bin .../icons/down-arrow_off.png | Bin .../icons/off.png | Bin .../icons/off_press.png | Bin .../icons/on.png | Bin .../icons/on_press.png | Bin .../icons/search_icon.png | Bin .../icons/up-arrow.png | Bin .../icons/up-arrow_hover.png | Bin .../icons/up-arrow_off.png | Bin .../icons/volume.png | Bin .../material_design_dark.qss | 34 +++++++++--------- .../colors.txt | 0 .../icons/down-arrow.png | Bin .../icons/down-arrow_hover.png | Bin .../icons/down-arrow_off.png | Bin .../icons/off.png | Bin .../icons/off_press.png | Bin .../icons/on.png | Bin .../icons/on_press.png | Bin .../icons/search_icon.png | Bin .../icons/up-arrow.png | Bin .../icons/up-arrow_hover.png | Bin .../icons/up-arrow_off.png | Bin .../icons/volume.png | Bin .../material_design_light.qss | 34 +++++++++--------- themesmanager.py | 8 ++--- 44 files changed, 71 insertions(+), 65 deletions(-) rename themes/{1-dark => dark}/colors.txt (100%) rename themes/{1-dark => dark}/dark.qss (88%) rename themes/{1-dark => dark}/icons/down-arrow.png (100%) rename themes/{1-dark => dark}/icons/down-arrow_hover.png (100%) rename themes/{1-dark => dark}/icons/down-arrow_off.png (100%) rename themes/{1-dark => dark}/icons/off.png (100%) rename themes/{1-dark => dark}/icons/off_press.png (100%) rename themes/{1-dark => dark}/icons/on.png (100%) rename themes/{1-dark => dark}/icons/on_press.png (100%) rename themes/{1-dark => dark}/icons/search_icon.png (100%) rename themes/{1-dark => dark}/icons/up-arrow.png (100%) rename themes/{1-dark => dark}/icons/up-arrow_hover.png (100%) rename themes/{1-dark => dark}/icons/up-arrow_off.png (100%) rename themes/{1-dark => dark}/icons/volume.png (100%) rename themes/{2-material_design_dark => material_design_dark}/colors.txt (100%) rename themes/{2-material_design_dark => material_design_dark}/icons/down-arrow.png (100%) rename themes/{2-material_design_dark => material_design_dark}/icons/down-arrow_hover.png (100%) rename themes/{2-material_design_dark => material_design_dark}/icons/down-arrow_off.png (100%) rename themes/{2-material_design_dark => material_design_dark}/icons/off.png (100%) rename themes/{2-material_design_dark => material_design_dark}/icons/off_press.png (100%) rename themes/{2-material_design_dark => material_design_dark}/icons/on.png (100%) rename themes/{2-material_design_dark => material_design_dark}/icons/on_press.png (100%) rename themes/{2-material_design_dark => material_design_dark}/icons/search_icon.png (100%) rename themes/{2-material_design_dark => material_design_dark}/icons/up-arrow.png (100%) rename themes/{2-material_design_dark => material_design_dark}/icons/up-arrow_hover.png (100%) rename themes/{2-material_design_dark => material_design_dark}/icons/up-arrow_off.png (100%) rename themes/{2-material_design_dark => material_design_dark}/icons/volume.png (100%) rename themes/{2-material_design_dark => material_design_dark}/material_design_dark.qss (87%) rename themes/{3-material_design_light => material_design_light}/colors.txt (100%) rename themes/{3-material_design_light => material_design_light}/icons/down-arrow.png (100%) rename themes/{3-material_design_light => material_design_light}/icons/down-arrow_hover.png (100%) rename themes/{3-material_design_light => material_design_light}/icons/down-arrow_off.png (100%) rename themes/{3-material_design_light => material_design_light}/icons/off.png (100%) rename themes/{3-material_design_light => material_design_light}/icons/off_press.png (100%) rename themes/{3-material_design_light => material_design_light}/icons/on.png (100%) rename themes/{3-material_design_light => material_design_light}/icons/on_press.png (100%) rename themes/{3-material_design_light => material_design_light}/icons/search_icon.png (100%) rename themes/{3-material_design_light => material_design_light}/icons/up-arrow.png (100%) rename themes/{3-material_design_light => material_design_light}/icons/up-arrow_hover.png (100%) rename themes/{3-material_design_light => material_design_light}/icons/up-arrow_off.png (100%) rename themes/{3-material_design_light => material_design_light}/icons/volume.png (100%) rename themes/{3-material_design_light => material_design_light}/material_design_light.qss (86%) diff --git a/artemis.py b/artemis.py index 65e6993..ab8d190 100644 --- a/artemis.py +++ b/artemis.py @@ -922,12 +922,13 @@ class Artemis(QMainWindow, Ui_MainWindow): ) ) - def collect_list(self, list_property): + def collect_list(self, list_property, separator=';'): values = self.db[list_property] values = list( - set( - values[values != Constants.UNKNOWN] - ) + set([ + x.strip() for value in values[values != Constants.UNKNOWN] + for x in value.split(separator) + ]) ) values.sort() values.insert(0, Constants.UNKNOWN) @@ -1249,7 +1250,10 @@ class Artemis(QMainWindow, Ui_MainWindow): return False selected_items = [item for item in self.mode_tree_widget.selectedItems()] selected_items_text = [i.text(0) for i in selected_items] - parents = [item for item in selected_items_text if item in Constants.MODES.keys()] + parents = [ + item for item in selected_items_text + if item in Constants.MODES.keys() + ] ok = [] for item in selected_items: if item.text(0) in parents: @@ -1261,9 +1265,11 @@ class Artemis(QMainWindow, Ui_MainWindow): def modulation_filters_ok(self, signal_name): if not self.apply_remove_modulation_filter_btn.isChecked(): return True - signal_modulation = self.db.at[signal_name, Signal.MODULATION] + signal_modulation = [ + x.strip() for x in self.db.at[signal_name, Signal.MODULATION].split(',') + ] for item in self.modulation_list.selectedItems(): - if item.text() == signal_modulation: + if item.text() in signal_modulation: return True return False @@ -1298,7 +1304,7 @@ class Artemis(QMainWindow, Ui_MainWindow): @pyqtSlot(QListWidgetItem, QListWidgetItem) def display_specs(self, item, previous_item): self.display_spectrogram() - if item: + if item is not None: self.current_signal_name = item.text() self.name_lab.setText(self.current_signal_name) self.name_lab.setAlignment(Qt.AlignHCenter) @@ -1383,12 +1389,12 @@ class Artemis(QMainWindow, Ui_MainWindow): path_spectr = default_pic self.spectrogram.setPixmap(QPixmap(path_spectr)) - def activate_band_category(self, band_label, activate = True): + def activate_band_category(self, band_label, activate=True): color = self.active_color if activate else self.inactive_color for label in band_label: label.setStyleSheet(f"color: {color};") - def set_band_range(self, current_signal = None): + def set_band_range(self, current_signal=None): if current_signal is not None and not is_undef_freq(current_signal): lower_freq = int(current_signal.at[Signal.INF_FREQ]) upper_freq = int(current_signal.at[Signal.SUP_FREQ]) diff --git a/themes/1-dark/colors.txt b/themes/dark/colors.txt similarity index 100% rename from themes/1-dark/colors.txt rename to themes/dark/colors.txt diff --git a/themes/1-dark/dark.qss b/themes/dark/dark.qss similarity index 88% rename from themes/1-dark/dark.qss rename to themes/dark/dark.qss index bece62f..64dba49 100644 --- a/themes/1-dark/dark.qss +++ b/themes/dark/dark.qss @@ -312,15 +312,15 @@ QComboBox::drop-down { } QComboBox::down-arrow:enabled { - image: url("./themes/2-dark/icons/down-arrow.png"); + image: url("./themes/dark/icons/down-arrow.png"); } QComboBox::down-arrow:disabled { - image: url("./themes/2-dark/icons/down-arrow_off.png"); + image: url("./themes/dark/icons/down-arrow_off.png"); } QComboBox::down-arrow:hover { - image: url("./themes/2-dark/icons/down-arrow_hover.png"); + image: url("./themes/dark/icons/down-arrow_hover.png"); } QComboBox::down-arrow:on { @@ -349,27 +349,27 @@ QRadioButton::indicator{ } QRadioButton::indicator::unchecked { - image: url("./themes/2-dark/icons/off.png"); + image: url("./themes/dark/icons/off.png"); } QRadioButton::indicator:unchecked:hover { - image: url("./themes/2-dark/icons/off_press.png"); + image: url("./themes/dark/icons/off_press.png"); } QRadioButton::indicator:unchecked:pressed { - image: url("./themes/2-dark/icons/off_press.png"); + image: url("./themes/dark/icons/off_press.png"); } QRadioButton::indicator::checked { - image: url("./themes/2-dark/icons/on.png"); + image: url("./themes/dark/icons/on.png"); } QRadioButton::indicator:checked:hover { - image: url("./themes/2-dark/icons/on_press.png"); + image: url("./themes/dark/icons/on_press.png"); } QRadioButton::indicator:checked:pressed { - image: url("./themes/2-dark/icons/on_press.png"); + image: url("./themes/dark/icons/on_press.png"); } /************************************* @@ -390,41 +390,41 @@ QSpinBox::up-button { subcontrol-origin: border; subcontrol-position: top right; width: 16px; - image: url("./themes/2-dark/icons/up-arrow.png"); + image: url("./themes/dark/icons/up-arrow.png"); border-width: 0px; } QSpinBox::up-button:hover { - image: url("./themes/2-dark/icons/up-arrow_hover.png"); + image: url("./themes/dark/icons/up-arrow_hover.png"); } QSpinBox::up-button:pressed { - image: url("./themes/2-dark/icons/up-arrow.png"); + image: url("./themes/dark/icons/up-arrow.png"); } QSpinBox::up-button:disabled { - image: url("./themes/2-dark/icons/up-arrow_off.png"); + image: url("./themes/dark/icons/up-arrow_off.png"); } QSpinBox::down-button { subcontrol-origin: border; subcontrol-position: bottom right; width: 16px; - image: url("./themes/2-dark/icons/down-arrow.png"); + image: url("./themes/dark/icons/down-arrow.png"); border-width: 0px; border-top-width: 0; } QSpinBox::down-button:hover { - image: url("./themes/2-dark/icons/down-arrow_hover.png"); + image: url("./themes/dark/icons/down-arrow_hover.png"); } QSpinBox::down-button:pressed { - image: url("./themes/2-dark/icons/down-arrow.png"); + image: url("./themes/dark/icons/down-arrow.png"); } QSpinBox::down-button:disabled { - image: url("./themes/2-dark/icons/down-arrow_off.png"); + image: url("./themes/dark/icons/down-arrow_off.png"); } /************************************* diff --git a/themes/1-dark/icons/down-arrow.png b/themes/dark/icons/down-arrow.png similarity index 100% rename from themes/1-dark/icons/down-arrow.png rename to themes/dark/icons/down-arrow.png diff --git a/themes/1-dark/icons/down-arrow_hover.png b/themes/dark/icons/down-arrow_hover.png similarity index 100% rename from themes/1-dark/icons/down-arrow_hover.png rename to themes/dark/icons/down-arrow_hover.png diff --git a/themes/1-dark/icons/down-arrow_off.png b/themes/dark/icons/down-arrow_off.png similarity index 100% rename from themes/1-dark/icons/down-arrow_off.png rename to themes/dark/icons/down-arrow_off.png diff --git a/themes/1-dark/icons/off.png b/themes/dark/icons/off.png similarity index 100% rename from themes/1-dark/icons/off.png rename to themes/dark/icons/off.png diff --git a/themes/1-dark/icons/off_press.png b/themes/dark/icons/off_press.png similarity index 100% rename from themes/1-dark/icons/off_press.png rename to themes/dark/icons/off_press.png diff --git a/themes/1-dark/icons/on.png b/themes/dark/icons/on.png similarity index 100% rename from themes/1-dark/icons/on.png rename to themes/dark/icons/on.png diff --git a/themes/1-dark/icons/on_press.png b/themes/dark/icons/on_press.png similarity index 100% rename from themes/1-dark/icons/on_press.png rename to themes/dark/icons/on_press.png diff --git a/themes/1-dark/icons/search_icon.png b/themes/dark/icons/search_icon.png similarity index 100% rename from themes/1-dark/icons/search_icon.png rename to themes/dark/icons/search_icon.png diff --git a/themes/1-dark/icons/up-arrow.png b/themes/dark/icons/up-arrow.png similarity index 100% rename from themes/1-dark/icons/up-arrow.png rename to themes/dark/icons/up-arrow.png diff --git a/themes/1-dark/icons/up-arrow_hover.png b/themes/dark/icons/up-arrow_hover.png similarity index 100% rename from themes/1-dark/icons/up-arrow_hover.png rename to themes/dark/icons/up-arrow_hover.png diff --git a/themes/1-dark/icons/up-arrow_off.png b/themes/dark/icons/up-arrow_off.png similarity index 100% rename from themes/1-dark/icons/up-arrow_off.png rename to themes/dark/icons/up-arrow_off.png diff --git a/themes/1-dark/icons/volume.png b/themes/dark/icons/volume.png similarity index 100% rename from themes/1-dark/icons/volume.png rename to themes/dark/icons/volume.png diff --git a/themes/2-material_design_dark/colors.txt b/themes/material_design_dark/colors.txt similarity index 100% rename from themes/2-material_design_dark/colors.txt rename to themes/material_design_dark/colors.txt diff --git a/themes/2-material_design_dark/icons/down-arrow.png b/themes/material_design_dark/icons/down-arrow.png similarity index 100% rename from themes/2-material_design_dark/icons/down-arrow.png rename to themes/material_design_dark/icons/down-arrow.png diff --git a/themes/2-material_design_dark/icons/down-arrow_hover.png b/themes/material_design_dark/icons/down-arrow_hover.png similarity index 100% rename from themes/2-material_design_dark/icons/down-arrow_hover.png rename to themes/material_design_dark/icons/down-arrow_hover.png diff --git a/themes/2-material_design_dark/icons/down-arrow_off.png b/themes/material_design_dark/icons/down-arrow_off.png similarity index 100% rename from themes/2-material_design_dark/icons/down-arrow_off.png rename to themes/material_design_dark/icons/down-arrow_off.png diff --git a/themes/2-material_design_dark/icons/off.png b/themes/material_design_dark/icons/off.png similarity index 100% rename from themes/2-material_design_dark/icons/off.png rename to themes/material_design_dark/icons/off.png diff --git a/themes/2-material_design_dark/icons/off_press.png b/themes/material_design_dark/icons/off_press.png similarity index 100% rename from themes/2-material_design_dark/icons/off_press.png rename to themes/material_design_dark/icons/off_press.png diff --git a/themes/2-material_design_dark/icons/on.png b/themes/material_design_dark/icons/on.png similarity index 100% rename from themes/2-material_design_dark/icons/on.png rename to themes/material_design_dark/icons/on.png diff --git a/themes/2-material_design_dark/icons/on_press.png b/themes/material_design_dark/icons/on_press.png similarity index 100% rename from themes/2-material_design_dark/icons/on_press.png rename to themes/material_design_dark/icons/on_press.png diff --git a/themes/2-material_design_dark/icons/search_icon.png b/themes/material_design_dark/icons/search_icon.png similarity index 100% rename from themes/2-material_design_dark/icons/search_icon.png rename to themes/material_design_dark/icons/search_icon.png diff --git a/themes/2-material_design_dark/icons/up-arrow.png b/themes/material_design_dark/icons/up-arrow.png similarity index 100% rename from themes/2-material_design_dark/icons/up-arrow.png rename to themes/material_design_dark/icons/up-arrow.png diff --git a/themes/2-material_design_dark/icons/up-arrow_hover.png b/themes/material_design_dark/icons/up-arrow_hover.png similarity index 100% rename from themes/2-material_design_dark/icons/up-arrow_hover.png rename to themes/material_design_dark/icons/up-arrow_hover.png diff --git a/themes/2-material_design_dark/icons/up-arrow_off.png b/themes/material_design_dark/icons/up-arrow_off.png similarity index 100% rename from themes/2-material_design_dark/icons/up-arrow_off.png rename to themes/material_design_dark/icons/up-arrow_off.png diff --git a/themes/2-material_design_dark/icons/volume.png b/themes/material_design_dark/icons/volume.png similarity index 100% rename from themes/2-material_design_dark/icons/volume.png rename to themes/material_design_dark/icons/volume.png diff --git a/themes/2-material_design_dark/material_design_dark.qss b/themes/material_design_dark/material_design_dark.qss similarity index 87% rename from themes/2-material_design_dark/material_design_dark.qss rename to themes/material_design_dark/material_design_dark.qss index 86f5544..68f799b 100644 --- a/themes/2-material_design_dark/material_design_dark.qss +++ b/themes/material_design_dark/material_design_dark.qss @@ -331,15 +331,15 @@ QComboBox::drop-down { } QComboBox::down-arrow:enabled { - image: url("./themes/3-material_design_dark/icons/down-arrow.png"); + image: url("./themes/material_design_dark/icons/down-arrow.png"); } QComboBox::down-arrow:disabled { - image: url("./themes/3-material_design_dark/icons/down-arrow_off.png"); + image: url("./themes/material_design_dark/icons/down-arrow_off.png"); } QComboBox::down-arrow:hover { - image: url("./themes/3-material_design_dark/icons/down-arrow_hover.png"); + image: url("./themes/material_design_dark/icons/down-arrow_hover.png"); } QComboBox::down-arrow:on { @@ -368,27 +368,27 @@ QRadioButton::indicator{ } QRadioButton::indicator::unchecked { - image: url("./themes/3-material_design_dark/icons/off.png"); + image: url("./themes/material_design_dark/icons/off.png"); } QRadioButton::indicator:unchecked:hover { - image: url("./themes/3-material_design_dark/icons/off_press.png"); + image: url("./themes/material_design_dark/icons/off_press.png"); } QRadioButton::indicator:unchecked:pressed { - image: url("./themes/3-material_design_dark/icons/off_press.png"); + image: url("./themes/material_design_dark/icons/off_press.png"); } QRadioButton::indicator::checked { - image: url("./themes/3-material_design_dark/icons/on.png"); + image: url("./themes/material_design_dark/icons/on.png"); } QRadioButton::indicator:checked:hover { - image: url("./themes/3-material_design_dark/icons/on_press.png"); + image: url("./themes/material_design_dark/icons/on_press.png"); } QRadioButton::indicator:checked:pressed { - image: url("./themes/3-material_design_dark/icons/on_press.png"); + image: url("./themes/material_design_dark/icons/on_press.png"); } /************************************* @@ -409,41 +409,41 @@ QSpinBox::up-button { subcontrol-origin: border; subcontrol-position: top right; width: 16px; - image: url("./themes/3-material_design_dark/icons/up-arrow.png"); + image: url("./themes/material_design_dark/icons/up-arrow.png"); border-width: 0px; } QSpinBox::up-button:hover { - image: url("./themes/3-material_design_dark/icons/up-arrow_hover.png"); + image: url("./themes/material_design_dark/icons/up-arrow_hover.png"); } QSpinBox::up-button:pressed { - image: url("./themes/3-material_design_dark/icons/up-arrow.png"); + image: url("./themes/material_design_dark/icons/up-arrow.png"); } QSpinBox::up-button:disabled { - image: url("./themes/3-material_design_dark/icons/up-arrow_off.png"); + image: url("./themes/material_design_dark/icons/up-arrow_off.png"); } QSpinBox::down-button { subcontrol-origin: border; subcontrol-position: bottom right; width: 16px; - image: url("./themes/3-material_design_dark/icons/down-arrow.png"); + image: url("./themes/material_design_dark/icons/down-arrow.png"); border-width: 0px; border-top-width: 0; } QSpinBox::down-button:hover { - image: url("./themes/3-material_design_dark/icons/down-arrow_hover.png"); + image: url("./themes/material_design_dark/icons/down-arrow_hover.png"); } QSpinBox::down-button:pressed { - image: url("./themes/3-material_design_dark/icons/down-arrow.png"); + image: url("./themes/material_design_dark/icons/down-arrow.png"); } QSpinBox::down-button:disabled { - image: url("./themes/3-material_design_dark/icons/down-arrow_off.png"); + image: url("./themes/material_design_dark/icons/down-arrow_off.png"); } /************************************* diff --git a/themes/3-material_design_light/colors.txt b/themes/material_design_light/colors.txt similarity index 100% rename from themes/3-material_design_light/colors.txt rename to themes/material_design_light/colors.txt diff --git a/themes/3-material_design_light/icons/down-arrow.png b/themes/material_design_light/icons/down-arrow.png similarity index 100% rename from themes/3-material_design_light/icons/down-arrow.png rename to themes/material_design_light/icons/down-arrow.png diff --git a/themes/3-material_design_light/icons/down-arrow_hover.png b/themes/material_design_light/icons/down-arrow_hover.png similarity index 100% rename from themes/3-material_design_light/icons/down-arrow_hover.png rename to themes/material_design_light/icons/down-arrow_hover.png diff --git a/themes/3-material_design_light/icons/down-arrow_off.png b/themes/material_design_light/icons/down-arrow_off.png similarity index 100% rename from themes/3-material_design_light/icons/down-arrow_off.png rename to themes/material_design_light/icons/down-arrow_off.png diff --git a/themes/3-material_design_light/icons/off.png b/themes/material_design_light/icons/off.png similarity index 100% rename from themes/3-material_design_light/icons/off.png rename to themes/material_design_light/icons/off.png diff --git a/themes/3-material_design_light/icons/off_press.png b/themes/material_design_light/icons/off_press.png similarity index 100% rename from themes/3-material_design_light/icons/off_press.png rename to themes/material_design_light/icons/off_press.png diff --git a/themes/3-material_design_light/icons/on.png b/themes/material_design_light/icons/on.png similarity index 100% rename from themes/3-material_design_light/icons/on.png rename to themes/material_design_light/icons/on.png diff --git a/themes/3-material_design_light/icons/on_press.png b/themes/material_design_light/icons/on_press.png similarity index 100% rename from themes/3-material_design_light/icons/on_press.png rename to themes/material_design_light/icons/on_press.png diff --git a/themes/3-material_design_light/icons/search_icon.png b/themes/material_design_light/icons/search_icon.png similarity index 100% rename from themes/3-material_design_light/icons/search_icon.png rename to themes/material_design_light/icons/search_icon.png diff --git a/themes/3-material_design_light/icons/up-arrow.png b/themes/material_design_light/icons/up-arrow.png similarity index 100% rename from themes/3-material_design_light/icons/up-arrow.png rename to themes/material_design_light/icons/up-arrow.png diff --git a/themes/3-material_design_light/icons/up-arrow_hover.png b/themes/material_design_light/icons/up-arrow_hover.png similarity index 100% rename from themes/3-material_design_light/icons/up-arrow_hover.png rename to themes/material_design_light/icons/up-arrow_hover.png diff --git a/themes/3-material_design_light/icons/up-arrow_off.png b/themes/material_design_light/icons/up-arrow_off.png similarity index 100% rename from themes/3-material_design_light/icons/up-arrow_off.png rename to themes/material_design_light/icons/up-arrow_off.png diff --git a/themes/3-material_design_light/icons/volume.png b/themes/material_design_light/icons/volume.png similarity index 100% rename from themes/3-material_design_light/icons/volume.png rename to themes/material_design_light/icons/volume.png diff --git a/themes/3-material_design_light/material_design_light.qss b/themes/material_design_light/material_design_light.qss similarity index 86% rename from themes/3-material_design_light/material_design_light.qss rename to themes/material_design_light/material_design_light.qss index 4874c85..603b459 100644 --- a/themes/3-material_design_light/material_design_light.qss +++ b/themes/material_design_light/material_design_light.qss @@ -331,15 +331,15 @@ QComboBox::drop-down { } QComboBox::down-arrow:enabled { - image: url("./themes/4-material_design_light/icons/down-arrow.png"); + image: url("./themes/material_design_light/icons/down-arrow.png"); } QComboBox::down-arrow:disabled { - image: url("./themes/4-material_design_light/icons/down-arrow_off.png"); + image: url("./themes/material_design_light/icons/down-arrow_off.png"); } QComboBox::down-arrow:hover { - image: url("./themes/4-material_design_light/icons/down-arrow_hover.png"); + image: url("./themes/material_design_light/icons/down-arrow_hover.png"); } QComboBox::down-arrow:on { @@ -368,27 +368,27 @@ QRadioButton::indicator{ } QRadioButton::indicator::unchecked { - image: url("./themes/4-material_design_light/icons/off.png"); + image: url("./themes/material_design_light/icons/off.png"); } QRadioButton::indicator:unchecked:hover { - image: url("./themes/4-material_design_light/icons/off_press.png"); + image: url("./themes/material_design_light/icons/off_press.png"); } QRadioButton::indicator:unchecked:pressed { - image: url("./themes/4-material_design_light/icons/off_press.png"); + image: url("./themes/material_design_light/icons/off_press.png"); } QRadioButton::indicator::checked { - image: url("./themes/4-material_design_light/icons/on.png"); + image: url("./themes/material_design_light/icons/on.png"); } QRadioButton::indicator:checked:hover { - image: url("./themes/4-material_design_light/icons/on_press.png"); + image: url("./themes/material_design_light/icons/on_press.png"); } QRadioButton::indicator:checked:pressed { - image: url("./themes/4-material_design_light/icons/on_press.png"); + image: url("./themes/material_design_light/icons/on_press.png"); } /************************************* @@ -409,41 +409,41 @@ QSpinBox::up-button { subcontrol-origin: border; subcontrol-position: top right; width: 16px; - image: url("./themes/4-material_design_light/icons/up-arrow.png"); + image: url("./themes/material_design_light/icons/up-arrow.png"); border-width: 0px; } QSpinBox::up-button:hover { - image: url("./themes/4-material_design_light/icons/up-arrow_hover.png"); + image: url("./themes/material_design_light/icons/up-arrow_hover.png"); } QSpinBox::up-button:pressed { - image: url("./themes/4-material_design_light/icons/up-arrow.png"); + image: url("./themes/material_design_light/icons/up-arrow.png"); } QSpinBox::up-button:disabled { - image: url("./themes/4-material_design_light/icons/up-arrow_off.png"); + image: url("./themes/material_design_light/icons/up-arrow_off.png"); } QSpinBox::down-button { subcontrol-origin: border; subcontrol-position: bottom right; width: 16px; - image: url("./themes/4-material_design_light/icons/down-arrow.png"); + image: url("./themes/material_design_light/icons/down-arrow.png"); border-width: 0px; border-top-width: 0; } QSpinBox::down-button:hover { - image: url("./themes/4-material_design_light/icons/down-arrow_hover.png"); + image: url("./themes/material_design_light/icons/down-arrow_hover.png"); } QSpinBox::down-button:pressed { - image: url("./themes/4-material_design_light/icons/down-arrow.png"); + image: url("./themes/material_design_light/icons/down-arrow.png"); } QSpinBox::down-button:disabled { - image: url("./themes/4-material_design_light/icons/down-arrow_off.png"); + image: url("./themes/material_design_light/icons/down-arrow_off.png"); } /************************************* diff --git a/themesmanager.py b/themesmanager.py index 788cc8e..b9947c8 100644 --- a/themesmanager.py +++ b/themesmanager.py @@ -14,7 +14,7 @@ class ThemeConstants: FOLDER = "themes" EXTENSION = ".qss" ICONS_FOLDER = "icons" - DEFAULT = "1-dark" + DEFAULT = "dark" CURRENT = ".current_theme" COLORS = "colors.txt" COLOR_SEPARATOR = "=" @@ -117,7 +117,7 @@ class ThemeManager: def __pretty_name(self, bad_name): return ' '.join( map(lambda s: s.capitalize(), - bad_name.split('-')[1].split('_') + bad_name.split('_') ) ) @@ -125,7 +125,7 @@ class ThemeManager: themes = [] ag = QActionGroup(self.__parent, exclusive=True) if os.path.exists(ThemeConstants.FOLDER): - for theme_folder in os.listdir(ThemeConstants.FOLDER): + for theme_folder in sorted(os.listdir(ThemeConstants.FOLDER)): relative_folder = os.path.join(ThemeConstants.FOLDER, theme_folder) if os.path.isdir(os.path.abspath(relative_folder)): relative_folder = os.path.join(ThemeConstants.FOLDER, theme_folder) @@ -157,7 +157,7 @@ class ThemeManager: return match_ok(colors) def __change(self): - theme_name = os.path.basename(self.__theme_path).split('-')[1] + ThemeConstants.EXTENSION + theme_name = os.path.basename(self.__theme_path) + ThemeConstants.EXTENSION try: with open( os.path.join(self.__theme_path, theme_name), "r"