Skip to content

Commit

Permalink
refac: tui: Redesign the action/key bar
Browse files Browse the repository at this point in the history
- Add: "action" and "disabled action" TUI palette entries.
- Change: Simplify the design of the keys and action names.
- Change: Use plain/default colors, improving the contrast for disabled
  actions.
- Change: Update the "key" and "disabled key" TUI palette entries.
  • Loading branch information
AnonymouX47 committed May 16, 2024
1 parent 41caf00 commit 5104df3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/termvisage/tui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,10 @@ def process_input(self, keys):
("unfocused box", "", "", "", "#7f7f7f", ""),
("focused box", "default"),
("green fg", "", "", "", "#00ff00", ""),
("key", "", "", "", "", "#5588ff"),
("disabled key", "", "", "", "#7f7f7f", "#5588ff"),
("key", "reverse"),
("action", "default"),
("disabled key", "", "", "", "#8f8f8f,italics,standout", ""),
("disabled action", "", "", "", "#8f8f8f,italics", ""),
("error", "", "", "", "bold", "#ff0000"),
("warning", "", "", "", "#ff0000,bold", ""),
("notif context", "", "", "", "#0000ff,bold", ""),
Expand Down
8 changes: 5 additions & 3 deletions src/termvisage/tui/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,11 @@ def display_context_keys(context: str) -> None:
key_bar.set_text(
[
[
("key" if enabled else "disabled key", action.replace(" ", "\u2800")),
("key", "\u2800"),
("key" if enabled else "disabled key", f"[{symbol}]"),
("key" if enabled else "disabled key", f"\u2800{symbol}\u2800"),
(
"action" if enabled else "disabled action",
"\u2800" + action.replace(" ", "\u2800")
),
" ",
]
for action, (_, symbol, _, visible, enabled) in actions
Expand Down

0 comments on commit 5104df3

Please sign in to comment.