mirror of
https://github.com/rr-/pq-cli.git
synced 2026-09-29 14:54:00 -06:00
ui: add shortcuts
This commit is contained in:
+13
-2
@@ -4,10 +4,21 @@ import urwid
|
||||
|
||||
|
||||
class MenuButton(urwid.Button):
|
||||
def __init__(self, label: str, *args: T.Any, **kwargs: T.Any) -> None:
|
||||
def __init__(
|
||||
self,
|
||||
label: str,
|
||||
*args: T.Any,
|
||||
hint: T.Optional[str] = None,
|
||||
**kwargs: T.Any
|
||||
) -> None:
|
||||
super().__init__("", *args, **kwargs)
|
||||
self._w = urwid.AttrMap(
|
||||
urwid.SelectableIcon(["\N{BULLET} ", label], 2),
|
||||
urwid.Columns(
|
||||
[
|
||||
urwid.SelectableIcon(["\N{BULLET} ", label], 2),
|
||||
("pack", urwid.Text(hint or "", align="right")),
|
||||
]
|
||||
),
|
||||
"button",
|
||||
"button-focus",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user