mirror of
https://github.com/rr-/pq-cli.git
synced 2026-09-28 22:33:59 -06:00
ui: rename Ui class to UrwidUserInterface
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import urwid
|
||||
|
||||
|
||||
class ReadOnlyCheckBox(urwid.Text):
|
||||
def __init__(self, text: str, state: bool = False) -> None:
|
||||
self.icons = {
|
||||
key: widget.text for key, widget in urwid.CheckBox.states.items()
|
||||
}
|
||||
self._caption = text
|
||||
|
||||
super().__init__("")
|
||||
|
||||
self.set_state(state)
|
||||
|
||||
def set_state(self, state: bool) -> None:
|
||||
self.set_text(self.icons[state] + " " + self._caption)
|
||||
Reference in New Issue
Block a user