diff --git a/assets/io.github.TheWisker.Cavasik.gschema.xml b/assets/io.github.TheWisker.Cavasik.gschema.xml
index 37d7c22..391a873 100644
--- a/assets/io.github.TheWisker.Cavasik.gschema.xml
+++ b/assets/io.github.TheWisker.Cavasik.gschema.xml
@@ -84,7 +84,12 @@
Mirror colors
Color profile for mirrored images
0
-
+
+
+ Sync mirror
+ Sync mirror color profile with normal color profile
+ true
+
Mirror clones
Clones to make in the overlapping mode
diff --git a/src/cava.py b/src/cava.py
index 80d0665..dae6d44 100644
--- a/src/cava.py
+++ b/src/cava.py
@@ -60,6 +60,7 @@ def load_settings(self):
self.monstercat = \
['off', 'monstercat'].index(self.settings['smoothing'])
self.noise_reduction = self.settings['noise-reduction']
+ print(self.noise_reduction)
def write_config(self):
try:
@@ -82,6 +83,7 @@ def write_config(self):
f'monstercat = {self.monstercat}',
f'noise_reduction = {self.noise_reduction}'
])
+ print(conf)
f.write(conf)
f.close()
except Exception as e:
diff --git a/src/drawing_area.py b/src/drawing_area.py
index e605146..d65ba3c 100644
--- a/src/drawing_area.py
+++ b/src/drawing_area.py
@@ -82,9 +82,12 @@ def on_settings_changed(self, key):
return
try:
- color_profile = self.settings['color-profiles'][ \
- self.settings['mirror-colors']]
- self.mirror_colors = color_profile[1]
+ if self.settings['mirror-sync']:
+ self.mirror_colors = self.colors
+ else:
+ color_profile = self.settings['color-profiles'][ \
+ self.settings['mirror-colors']]
+ self.mirror_colors = color_profile[1]
except:
self.settings['mirror-colors'] = 0
return
diff --git a/src/preferences_window.py b/src/preferences_window.py
index 8c7f7c8..b916915 100644
--- a/src/preferences_window.py
+++ b/src/preferences_window.py
@@ -510,6 +510,13 @@ def create_colors_page(self):
self.mirror_colors_group = Adw.PreferencesGroup.new()
self.colors_page.add(self.mirror_colors_group)
+ self.pref_mirror_sync = Adw.ActionRow.new()
+ self.pref_mirror_sync.set_title(_('Sync mirror'))
+ self.pref_mirror_sync_switch = Gtk.Switch.new()
+ self.pref_mirror_sync_switch.set_valign(Gtk.Align.CENTER)
+ self.pref_mirror_sync.add_suffix(self.pref_mirror_sync_switch)
+ self.pref_mirror_sync.set_activatable_widget(self.pref_mirror_sync_switch)
+ self.mirror_colors_group.add(self.pref_mirror_sync)
self.pref_mirror_colors = Adw.ComboRow.new()
self.pref_mirror_colors.set_title(_('Mirror Color'))
self.pref_mirror_colors.set_subtitle(_('Color profile for mirrored images'))
@@ -627,7 +634,9 @@ def load_settings(self):
self.profile_remove_button.set_sensitive(active_profile != 0)
self.clear_colors_grid()
self.fill_colors_grid()
+ self.pref_mirror_sync_switch.set_active(self.settings['mirror-sync'])
self.pref_mirror_colors.set_selected(self.settings['mirror-colors'])
+ self.pref_mirror_colors.set_sensitive(not self.settings['mirror-sync'])
self.pref_color_animation_switch.set_active(self.settings['color-animation'])
self.pref_color_animation_target.set_selected(self.settings['color-animation-target'])
self.pref_color_animation_mirror_target.set_selected(self.settings['color-animation-mirror-target'])
@@ -742,6 +751,9 @@ def bind_settings(self):
self.profiles_dropdown.connect('notify::selected', \
self.select_color_profile, self.profiles_dropdown, 'active-color-profile')
+ self.pref_mirror_sync_switch.connect('notify::state', \
+ lambda *args : self.save_setting(self.pref_mirror_sync_switch, \
+ 'mirror-sync', self.pref_mirror_sync_switch.get_state()))
self.pref_mirror_colors.connect('notify::selected-item', self.select_color_profile, self.pref_mirror_colors, 'mirror-colors')
self.pref_color_animation_switch.connect('notify::state', \
lambda *args : self.save_setting(self.pref_color_animation_switch, \