summaryrefslogtreecommitdiff
path: root/lib/extensions/params.py
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2023-03-07 12:13:57 -0500
committerGitHub <noreply@github.com>2023-03-07 18:13:57 +0100
commit74157dd1cb9adada35c2079c1e053e0b4b2dec19 (patch)
treef2efb20ce8df1733805f86f67678380c533bf640 /lib/extensions/params.py
parent9552291de5c7f1236542e9be3f1816e29701b7ed (diff)
meander: pick ending point far from starting point (#2095)
Diffstat (limited to 'lib/extensions/params.py')
-rw-r--r--lib/extensions/params.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/extensions/params.py b/lib/extensions/params.py
index 6c0f12c5..802086d8 100644
--- a/lib/extensions/params.py
+++ b/lib/extensions/params.py
@@ -149,11 +149,11 @@ class ParamsTab(ScrolledPanel):
def update_combo_state(self, event=None):
self.update_choice_state(event, True)
- def get_combo_value_index(self, param, options):
+ def get_combo_value_index(self, param, options, default):
for option in options:
if option.id == param:
return options.index(option)
- return 0
+ return default
def pair_changed(self, value):
new_value = not value
@@ -407,8 +407,7 @@ class ParamsTab(ScrolledPanel):
input.Append(option.name, image, option)
if not param.options:
input.Append(_('No options available'), ParamOption('not_available'))
-
- value = self.get_combo_value_index(param.values[0], param.options)
+ value = self.get_combo_value_index(param.values[0], param.options, param.default or 0)
input.SetSelection(value)
input.Bind(wx.EVT_COMBOBOX, self.changed)
input.Bind(wx.EVT_COMBOBOX, self.update_combo_state)