summaryrefslogtreecommitdiff
path: root/lib/gui
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2025-08-30 02:33:24 -0400
committerGitHub <noreply@github.com>2025-08-30 08:33:24 +0200
commitd22f9d86f4796bfabc6a629b659c94f920f8a4ce (patch)
treeb8b0301685472cc6c3c59689c28c2e6ebfb47ac5 /lib/gui
parent28eaecabf236d18067acf2f725094c224362e245 (diff)
preset-related fixes (#3931)
* fix manually clicking pencil icon * update choices when loading presets * ignore hidden and disabled params when applying and creating presets * mark selection param changed when a dependent param is changed * don't immediately apply when clicking 'Use Last Settings' * define on_change_hook in __init__ * make adding, updating, and deleting presets clearer * only skip satin param for strokes thinner than 0.3mm when they have only one subpath
Diffstat (limited to 'lib/gui')
-rw-r--r--lib/gui/presets.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/gui/presets.py b/lib/gui/presets.py
index 150f8fbd..54c53c1c 100644
--- a/lib/gui/presets.py
+++ b/lib/gui/presets.py
@@ -102,9 +102,12 @@ class PresetsPanel(wx.Panel):
json.dump(presets, presets_file)
def update_preset_list(self):
+ current_preset = self.preset_chooser.GetValue().strip()
preset_names = list(self._load_presets().keys())
preset_names = [preset for preset in preset_names if not self.is_hidden(preset)]
self.preset_chooser.SetItems(sorted(preset_names))
+ if current_preset in preset_names:
+ self.preset_chooser.SetValue(current_preset)
def is_hidden(self, preset_name):
return self.HIDDEN_PRESET_RE.match(preset_name)
@@ -141,6 +144,11 @@ class PresetsPanel(wx.Panel):
self.store_preset(preset_name, self.parent.get_preset_data())
+ if overwrite:
+ info_dialog(self, _('Preset "%s" updated.') % preset_name)
+ else:
+ info_dialog(self, _('Preset "%s" added.') % preset_name)
+
event.Skip()
def overwrite_preset(self, event):
@@ -178,4 +186,6 @@ class PresetsPanel(wx.Panel):
self.update_preset_list()
self.preset_chooser.SetValue("")
+ info_dialog(self, _('Preset "%s" deleted.') % preset_name)
+
event.Skip()