mirror of
https://github.com/SeedSigner/seedsigner.git
synced 2026-10-05 15:08:25 +00:00
Merge pull request #742 from kdmukai/pre_scrolling_button_list_fix
[bugfix] Only apply auto-scroll `ButtonListScreen` logic for long lists that need it
This commit is contained in:
@@ -326,14 +326,14 @@ class ButtonListScreen(BaseTopNavScreen):
|
||||
button_list_y = self.top_nav.height
|
||||
self.has_scroll_arrows = True
|
||||
|
||||
# How many buttons fit on the screen before we need to start scrolling?
|
||||
num_buttons_pre_scroll = math.floor((self.canvas_height - button_list_y - GUIConstants.EDGE_PADDING) / (button_height + GUIConstants.LIST_ITEM_PADDING))
|
||||
# How many buttons fit on the screen before we need to start scrolling?
|
||||
num_buttons_pre_scroll = math.floor((self.canvas_height - button_list_y - GUIConstants.EDGE_PADDING) / (button_height + GUIConstants.LIST_ITEM_PADDING))
|
||||
|
||||
# Force a scroll offset when necessary if none was provided
|
||||
if self.selected_button + 1 > num_buttons_pre_scroll and not self.scroll_y_initial_offset:
|
||||
# Scroll far enough to expose the selected button; +1 to account for the
|
||||
# height of the target button itself!
|
||||
self.scroll_y_initial_offset = (button_height + GUIConstants.LIST_ITEM_PADDING) * (self.selected_button - num_buttons_pre_scroll + 1)
|
||||
# Force a scroll offset when necessary if none was provided
|
||||
if self.selected_button + 1 > num_buttons_pre_scroll and not self.scroll_y_initial_offset:
|
||||
# Scroll far enough to expose the selected button; +1 to account for the
|
||||
# height of the target button itself!
|
||||
self.scroll_y_initial_offset = (button_height + GUIConstants.LIST_ITEM_PADDING) * (self.selected_button - num_buttons_pre_scroll + 1)
|
||||
|
||||
self.buttons: List[Button] = []
|
||||
for i, button_option in enumerate(self.button_data):
|
||||
|
||||
@@ -169,7 +169,6 @@ def generate_screenshots(locale):
|
||||
dict(
|
||||
visibility=SettingsConstants.VISIBILITY__ADVANCED,
|
||||
selected_attr=SettingsConstants.SETTING__ELECTRUM_SEEDS,
|
||||
initial_scroll=240, # Just guessing how many pixels to scroll down
|
||||
),
|
||||
screenshot_name="SettingsMenuView__Advanced"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user