Reorder Settings screenshots, remove 320x240 hard coding

This commit is contained in:
kdmukai
2025-04-28 14:09:20 -05:00
parent d8c2833d6e
commit e00f0a2db6
2 changed files with 27 additions and 32 deletions
+33 -38
View File
@@ -162,49 +162,17 @@ def generate_screenshots(locale):
"addr_format": embit_utils.parse_derivation_path(derivation_path)
}
# Automatically populate all Settings options Views
settings_views_list = []
settings_views_list.append(ScreenshotConfig(settings_views.SettingsMenuView))
settings_views_list.append(
ScreenshotConfig(
settings_views.SettingsMenuView,
dict(
visibility=SettingsConstants.VISIBILITY__ADVANCED,
selected_attr=SettingsConstants.SETTING__ELECTRUM_SEEDS,
),
screenshot_name="SettingsMenuView__Advanced"
)
)
# Render the nested "Hardware" submenu option at the end of "Advanced"
num_advanced_settings = len(SettingsDefinition.get_settings_entries(visibility=SettingsConstants.VISIBILITY__ADVANCED)) - 5 # hard-coded for 240px height: the first 5 settings options are already visible
settings_views_list.append(
ScreenshotConfig(
settings_views.SettingsMenuView,
dict(
visibility=SettingsConstants.VISIBILITY__ADVANCED,
selected_attr=SettingsConstants.SETTING__PARTNER_LOGOS,
initial_scroll=num_advanced_settings*GUIConstants.BUTTON_HEIGHT + (num_advanced_settings-1)*GUIConstants.COMPONENT_PADDING, # Force menu to scroll to the bottom
),
screenshot_name="SettingsMenuView__Advanced_Hardware"
)
)
settings_views_list.append(
ScreenshotConfig(
settings_views.SettingsMenuView,
dict(visibility=SettingsConstants.VISIBILITY__HARDWARE),
screenshot_name="SettingsMenuView__Hardware"
)
)
# so we get a choice for transcribe seed qr format
controller.settings.set_value(
attr_name=SettingsConstants.SETTING__COMPACT_SEEDQR,
value=SettingsConstants.OPTION__ENABLED
)
# Automatically populate all Settings options Views
settings_views_list = []
def add_settings_entries(visibility = SettingsConstants.VISIBILITY__GENERAL):
for settings_entry in SettingsDefinition.settings_entries:
if settings_entry.visibility == SettingsConstants.VISIBILITY__HIDDEN:
if settings_entry.visibility != visibility:
continue
if settings_entry.attr_name == SettingsConstants.SETTING__LOCALE:
@@ -214,10 +182,37 @@ def generate_screenshots(locale):
# Generic SettingsEntry selection View
settings_views_list.append(ScreenshotConfig(settings_views.SettingsEntryUpdateSelectionView, dict(attr_name=settings_entry.attr_name), screenshot_name=f"SettingsEntryUpdateSelectionView_{settings_entry.attr_name}"))
# Add the top level "General" settings menu and entries
settings_views_list.append(ScreenshotConfig(settings_views.SettingsMenuView))
add_settings_entries(SettingsConstants.VISIBILITY__GENERAL)
# Add the "Advanced" menu...
settings_views_list.append(
ScreenshotConfig(
settings_views.SettingsMenuView,
dict(
visibility=SettingsConstants.VISIBILITY__ADVANCED,
),
screenshot_name="SettingsMenuView__Advanced"
)
)
# ...and Advanced entries
add_settings_entries(SettingsConstants.VISIBILITY__ADVANCED)
# Render the nested "Advanced" -> "Hardware" submenu
settings_views_list.append(
ScreenshotConfig(
settings_views.SettingsMenuView,
dict(visibility=SettingsConstants.VISIBILITY__HARDWARE),
screenshot_name="SettingsMenuView__Hardware"
)
)
add_settings_entries(SettingsConstants.VISIBILITY__HARDWARE)
settingsqr_data_persistent = f"settings::v1 name=English_noob_mode persistent=E coords=spa,spd denom=thr network=M qr_density=M xpub_export=E sigs=ss scripts=nat xpub_details=E passphrase=E camera=0 compact_seedqr=E bip85=D priv_warn=E dire_warn=E partners=E locale={locale}"
settingsqr_data_not_persistent = f"settings::v1 name=Mode_Ephemeral persistent=D coords=spa,spd denom=thr network=M qr_density=M xpub_export=E sigs=ss scripts=nat xpub_details=E passphrase=E camera=0 compact_seedqr=E bip85=D priv_warn=E dire_warn=E partners=E locale={locale}"
# Set up screenshot-specific callbacks to inject data before the View is run and
# reset data after the View is run.
def load_basic_psbt_cb():
+1 -1
View File
@@ -25,7 +25,7 @@ class ScreenshotRenderer(Renderer):
cls._instance = renderer
# Hard-coding output values for now
renderer.canvas_width = 320
renderer.canvas_width = 240
renderer.canvas_height = 240
renderer.canvas = Image.new('RGB', (renderer.canvas_width, renderer.canvas_height))