make-selection 1.0.4__tar.gz → 1.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {make_selection-1.0.4 → make_selection-1.0.5}/PKG-INFO +1 -1
- {make_selection-1.0.4 → make_selection-1.0.5}/pyproject.toml +1 -1
- {make_selection-1.0.4 → make_selection-1.0.5}/src/make_selection/make_selection.py +28 -1
- {make_selection-1.0.4 → make_selection-1.0.5}/src/make_selection.egg-info/PKG-INFO +1 -1
- {make_selection-1.0.4 → make_selection-1.0.5}/LICENSE +0 -0
- {make_selection-1.0.4 → make_selection-1.0.5}/README.md +0 -0
- {make_selection-1.0.4 → make_selection-1.0.5}/setup.cfg +0 -0
- {make_selection-1.0.4 → make_selection-1.0.5}/src/make_selection/__init__.py +0 -0
- {make_selection-1.0.4 → make_selection-1.0.5}/src/make_selection.egg-info/SOURCES.txt +0 -0
- {make_selection-1.0.4 → make_selection-1.0.5}/src/make_selection.egg-info/dependency_links.txt +0 -0
- {make_selection-1.0.4 → make_selection-1.0.5}/src/make_selection.egg-info/top_level.txt +0 -0
|
@@ -145,7 +145,7 @@ class Menu:
|
|
|
145
145
|
self.options_current.remove(selected_option)
|
|
146
146
|
self.options_original.remove(selected_option)
|
|
147
147
|
self.options_selected.append(selected_option)
|
|
148
|
-
self.
|
|
148
|
+
self.resetWindowMultiSelect()
|
|
149
149
|
|
|
150
150
|
def multiSelectGetValues(self, options: list[Option]) -> list[Any]:
|
|
151
151
|
return [op.value for op in options]
|
|
@@ -161,6 +161,33 @@ class Menu:
|
|
|
161
161
|
self.selected_index = 0
|
|
162
162
|
self.window_size_current = min((len(self.options_current), self.window_size_original))
|
|
163
163
|
|
|
164
|
+
def resetWindowMultiSelect(self):
|
|
165
|
+
"""
|
|
166
|
+
After selecting item and shrinking the list we try would like to keep
|
|
167
|
+
the selected_index and window the same. This visually looks like the
|
|
168
|
+
list is being pulled up and the selected index goes to the next item.
|
|
169
|
+
|
|
170
|
+
First we will try and shift the window up, keeping the selected index
|
|
171
|
+
the same. Visually this looks a bit weird as the selected index looks
|
|
172
|
+
to be moving down the list, but the behavior I think is good because
|
|
173
|
+
the index goes to the next item in the list. If we kept the index static
|
|
174
|
+
on the screen it would be moving to the previous item instead of the next
|
|
175
|
+
which I don't think I want.
|
|
176
|
+
|
|
177
|
+
If we can't keep the list the same or shift the window up, that means the
|
|
178
|
+
list is too small and we will just shrink the window.
|
|
179
|
+
"""
|
|
180
|
+
window_bottom_current = self.window_top + self.window_size_current
|
|
181
|
+
if len(self.options_current) < window_bottom_current:
|
|
182
|
+
if 0 < self.window_top:
|
|
183
|
+
self.window_top -= 1
|
|
184
|
+
else:
|
|
185
|
+
self.window_size_current -= 1
|
|
186
|
+
# NOTE: this must be calculated after we change top/size above
|
|
187
|
+
window_bottom_new = self.window_top + self.window_size_current
|
|
188
|
+
if window_bottom_new <= self.selected_index:
|
|
189
|
+
self.selected_index -= 1
|
|
190
|
+
|
|
164
191
|
def clearMenu(self):
|
|
165
192
|
"""
|
|
166
193
|
Clears from beginning of current line to end of screen (not end of line).
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{make_selection-1.0.4 → make_selection-1.0.5}/src/make_selection.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|