Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/menu/selection_menu.py
diff options
context:
space:
mode:
authorWerner Llácer <wllacer@gmail.com>2022-03-01 12:36:58 +0100
committerGitHub <noreply@github.com>2022-03-01 12:36:58 +0100
commit47a9fba94b819c4184b0378b1241857df1e0ba39 (patch)
tree6eaff298bf92a529ef127a008e1fbbe9d4cf0c32 /archinstall/lib/menu/selection_menu.py
parent86d991f4422d920ca714f459be3be4352d1c40a1 (diff)
A couple of corrections for the user interface (#1017)
* Preview size is now an argument for GeneralMenu Parameter missing in call to save_config * Update selection_menu.py Co-authored-by: Anton Hvornum <anton.feeds+github@gmail.com>
Diffstat (limited to 'archinstall/lib/menu/selection_menu.py')
-rw-r--r--archinstall/lib/menu/selection_menu.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/archinstall/lib/menu/selection_menu.py b/archinstall/lib/menu/selection_menu.py
index 8ac7dc99..9b40b0e7 100644
--- a/archinstall/lib/menu/selection_menu.py
+++ b/archinstall/lib/menu/selection_menu.py
@@ -179,7 +179,7 @@ class Selector:
self.set_enabled(True)
class GeneralMenu:
- def __init__(self, data_store :dict = None, auto_cursor=False):
+ def __init__(self, data_store :dict = None, auto_cursor=False, preview_size :float = 0.2):
"""
Create a new selection menu.
@@ -189,6 +189,9 @@ class GeneralMenu:
:param auto_cursor: Boolean which determines if the cursor stays on the first item (false) or steps each invocation of a selection entry (true)
:type auto_cursor: bool
+ :param preview_size. Size in fractions of screen size of the preview window
+ ;type preview_size: float (range 0..1)
+
"""
self._translation = Translation.load_nationalization()
self.is_context_mgr = False
@@ -196,6 +199,7 @@ class GeneralMenu:
self.auto_cursor = auto_cursor
self._menu_options = {}
self._setup_selection_menu_options()
+ self.preview_size = preview_size
def __enter__(self, *args :Any, **kwargs :Any) -> GeneralMenu:
self.is_context_mgr = True
@@ -292,7 +296,7 @@ class GeneralMenu:
sort=False,
cursor_index=cursor_pos,
preview_command=self._preview_display,
- preview_size=0.5
+ preview_size=self.preview_size
).run()
if selection and self.auto_cursor:
@@ -551,7 +555,7 @@ class GlobalMenu(GeneralMenu):
self._menu_options['save_config'] = \
Selector(
_('Save configuration'),
- lambda: save_config(self._data_store),
+ lambda preset: save_config(self._data_store),
enabled=True,
no_store=True)
self._menu_options['install'] = \
@@ -688,4 +692,4 @@ class GlobalMenu(GeneralMenu):
def _users_resynch(self):
self.synch('!superusers')
self.synch('!users')
- return False \ No newline at end of file
+ return False