vimsheet.ui.status_bar
Status bar widget — mode, position, stats, file status, clock.
- class vimsheet.ui.status_bar.MessageEntry(text, timestamp, level)[source]
Bases:
objectA single status bar message stored in history.
- class vimsheet.ui.status_bar.StatusBar(*args, **kwargs)[source]
Bases:
WidgetBottom status bar displaying context-sensitive information.
- Parameters:
args (Any)
kwargs (Any)
- DEFAULT_CSS = '\n StatusBar {\n height: 1;\n layout: horizontal;\n background: $surface;\n color: $text;\n }\n StatusBar .segment {\n padding: 0 1;\n content-align: left middle;\n }\n StatusBar #status-mode {\n width: 10;\n background: $primary;\n content-align: center middle;\n text-style: bold;\n }\n StatusBar #status-sheet {\n width: 16;\n background: $primary-darken-1;\n text-style: bold;\n }\n StatusBar #status-pos {\n width: 14;\n }\n StatusBar #status-stats {\n width: 12;\n }\n StatusBar #status-message {\n width: 1fr;\n color: $text-warning;\n }\n StatusBar #status-file-state {\n width: 10;\n }\n StatusBar #status-filename {\n width: 24;\n }\n StatusBar #status-clock {\n width: 10;\n }\n '
Default TCSS.
- mode: reactive[Mode]
Create a reactive attribute.
- Parameters:
default – A default value or callable that returns a default.
layout – Perform a layout on change.
repaint – Perform a repaint on change.
init – Call watchers on initialize (post mount).
always_update – Call watchers even when the new value equals the old value.
recompose – Compose the widget again when the attribute changes.
bindings – Refresh bindings when the reactive changes.
toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.
- sheet_name: reactive[str]
Create a reactive attribute.
- Parameters:
default – A default value or callable that returns a default.
layout – Perform a layout on change.
repaint – Perform a repaint on change.
init – Call watchers on initialize (post mount).
always_update – Call watchers even when the new value equals the old value.
recompose – Compose the widget again when the attribute changes.
bindings – Refresh bindings when the reactive changes.
toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.
- cell_address: reactive[str]
Create a reactive attribute.
- Parameters:
default – A default value or callable that returns a default.
layout – Perform a layout on change.
repaint – Perform a repaint on change.
init – Call watchers on initialize (post mount).
always_update – Call watchers even when the new value equals the old value.
recompose – Compose the widget again when the attribute changes.
bindings – Refresh bindings when the reactive changes.
toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.
- row: reactive[int]
Create a reactive attribute.
- Parameters:
default – A default value or callable that returns a default.
layout – Perform a layout on change.
repaint – Perform a repaint on change.
init – Call watchers on initialize (post mount).
always_update – Call watchers even when the new value equals the old value.
recompose – Compose the widget again when the attribute changes.
bindings – Refresh bindings when the reactive changes.
toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.
- col: reactive[int]
Create a reactive attribute.
- Parameters:
default – A default value or callable that returns a default.
layout – Perform a layout on change.
repaint – Perform a repaint on change.
init – Call watchers on initialize (post mount).
always_update – Call watchers even when the new value equals the old value.
recompose – Compose the widget again when the attribute changes.
bindings – Refresh bindings when the reactive changes.
toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.
- used_rows: reactive[int]
Create a reactive attribute.
- Parameters:
default – A default value or callable that returns a default.
layout – Perform a layout on change.
repaint – Perform a repaint on change.
init – Call watchers on initialize (post mount).
always_update – Call watchers even when the new value equals the old value.
recompose – Compose the widget again when the attribute changes.
bindings – Refresh bindings when the reactive changes.
toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.
- filename: reactive[str]
Create a reactive attribute.
- Parameters:
default – A default value or callable that returns a default.
layout – Perform a layout on change.
repaint – Perform a repaint on change.
init – Call watchers on initialize (post mount).
always_update – Call watchers even when the new value equals the old value.
recompose – Compose the widget again when the attribute changes.
bindings – Refresh bindings when the reactive changes.
toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.
- file_modified: reactive[bool]
Create a reactive attribute.
- Parameters:
default – A default value or callable that returns a default.
layout – Perform a layout on change.
repaint – Perform a repaint on change.
init – Call watchers on initialize (post mount).
always_update – Call watchers even when the new value equals the old value.
recompose – Compose the widget again when the attribute changes.
bindings – Refresh bindings when the reactive changes.
toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.
- message: reactive[str]
Create a reactive attribute.
- Parameters:
default – A default value or callable that returns a default.
layout – Perform a layout on change.
repaint – Perform a repaint on change.
init – Call watchers on initialize (post mount).
always_update – Call watchers even when the new value equals the old value.
recompose – Compose the widget again when the attribute changes.
bindings – Refresh bindings when the reactive changes.
toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.
- message_history: deque[MessageEntry]
- set_history_size(size)[source]
Change the max length of the message history deque.
- Parameters:
size (int)
- Return type:
None
- watch_cell_address(value)[source]
Update cell address label.
- Parameters:
value (str)
- Return type:
None
- watch_file_modified(value)[source]
Update file-state label.
- Parameters:
value (bool)
- Return type:
None
- watch_message(value)[source]
Update transient message label.
- Parameters:
value (str)
- Return type:
None
- show_message(text, duration=3.0, priority=3, level=None)[source]
Show a transient message.
Skipped if a higher-priority message is currently displayed.
level is
"info","error", or"success"— controls the display colour and is stored in the message history.If level is
None(default), it is auto-detected from the message text using keyword matching.
- set_persistent_message(text, priority=2)[source]
Show a message with no auto-clear timer (for prompts).
Skipped if a higher-priority message is currently displayed. Pass empty string + appropriate priority to clear.
- can_focus = False
Widget may receive focus.
- can_focus_children = True
Widget’s children may receive focus.