Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple menu for better UX #660

Merged
merged 25 commits into from
Dec 2, 2021
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
deff005
Add simple menu for better UX
svartkanin Oct 11, 2021
0e7969c
PR feedback
svartkanin Oct 27, 2021
697dce9
Merge remote-tracking branch 'origin/master' into add-menu
svartkanin Nov 7, 2021
bdcf33c
Add remove external dependency
svartkanin Nov 8, 2021
36ed68b
Fix harddisk return value on skip
svartkanin Nov 8, 2021
5e555f7
Table output for partitioning process
svartkanin Nov 8, 2021
bb915a3
Switch partitioning to simple menu
svartkanin Nov 9, 2021
956b614
fixup! Switch partitioning to simple menu
svartkanin Nov 10, 2021
e3bf635
Uncomment
svartkanin Nov 10, 2021
4028936
Update
svartkanin Nov 10, 2021
cbfcf33
Simplify code
svartkanin Nov 10, 2021
ac173c0
Calling fs_types() to get the response
Torxed Nov 11, 2021
c57bf22
Ignoring complexity and binary operator issues
Torxed Nov 11, 2021
07a520e
Added license text to the MIT licensed file
Torxed Nov 11, 2021
67ae610
Added in versioning information
Torxed Nov 11, 2021
638f970
Linting issue fix
Torxed Nov 11, 2021
4e9330a
Merged latest master
Torxed Nov 11, 2021
54a65b6
Pulled fix for multi select search
svartkanin Nov 20, 2021
1f8f487
Merged master
Nov 25, 2021
73a5e0b
Fixed some imports and removed the last generic_select() from user_in…
Nov 25, 2021
399cfd7
Incorrect usage of archinstall. inside the library.
Nov 25, 2021
a5eee0c
Update color scheme to match Arch style better
dylanmtaylor Nov 26, 2021
9b2252d
Use cyan as default cursor color
dylanmtaylor Nov 26, 2021
c7194da
Leave simple menu the same
dylanmtaylor Nov 29, 2021
fc2e72a
Merge pull request #1 from dylanmtaylor/patch-1
svartkanin Nov 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Pulled fix for multi select search
  • Loading branch information
svartkanin committed Nov 20, 2021
commit 54a65b63887499c8d8199ca40cc35f877ce9d9b2
13 changes: 11 additions & 2 deletions archinstall/lib/simple_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@ def displayed_selected_indices(self) -> List[int]:
if selected_index in self._menu_index_to_displayed_index
]

def __bool__(self) -> bool:
return self._active_displayed_index is not None

def __iter__(self) -> Iterator[Tuple[int, int, str]]:
for displayed_index, menu_index in enumerate(self._displayed_index_to_menu_index):
if self._viewport.lower_index <= displayed_index <= self._viewport.upper_index:
Expand Down Expand Up @@ -1326,10 +1329,13 @@ def prepare_multi_select_cursors() -> Tuple[str, str]:
)
return cursor_styled, cursor_with_brackets_only_styled

if not self._view:
return
checked_multi_select_cursor, unchecked_multi_select_cursor = prepare_multi_select_cursors()
cursor_width = wcswidth(self._menu_cursor)
displayed_selected_indices = self._view.displayed_selected_indices
for displayed_index in range(self._viewport.lower_index, self._viewport.upper_index + 1):
displayed_index = 0
for displayed_index, _, _ in self._view:
self._tty_out.write("\r" + cursor_width * self._codename_to_terminal_code["cursor_right"])
if displayed_index in displayed_selected_indices:
self._tty_out.write(checked_multi_select_cursor)
Expand All @@ -1338,7 +1344,10 @@ def prepare_multi_select_cursors() -> Tuple[str, str]:
if displayed_index < self._viewport.upper_index:
self._tty_out.write(self._codename_to_terminal_code["cursor_down"])
self._tty_out.write("\r")
self._tty_out.write((self._viewport.size - 1) * self._codename_to_terminal_code["cursor_up"])
self._tty_out.write(
(displayed_index + (1 if displayed_index < self._viewport.upper_index else 0))
* self._codename_to_terminal_code["cursor_up"]
)

# pylint: disable=unsubscriptable-object
assert self._codename_to_terminal_code is not None
Expand Down