Skip to content

Commit

Permalink
Version 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWisker committed Aug 31, 2023
1 parent cdf15ca commit 5a114a3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
7 changes: 6 additions & 1 deletion assets/io.github.TheWisker.Cavasik.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@
<summary>Mirror colors</summary>
<description>Color profile for mirrored images</description>
<default>0</default>
</key>
</key>
<key name="mirror-sync" type="b">
<summary>Sync mirror</summary>
<description>Sync mirror color profile with normal color profile</description>
<default>true</default>
</key>
<key name="mirror-clones" type="i">
<summary>Mirror clones</summary>
<description>Clones to make in the overlapping mode</description>
Expand Down
2 changes: 2 additions & 0 deletions src/cava.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
9 changes: 6 additions & 3 deletions src/drawing_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions src/preferences_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down Expand Up @@ -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'])
Expand Down Expand Up @@ -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, \
Expand Down

0 comments on commit 5a114a3

Please sign in to comment.