Skip to content

Commit

Permalink
Reviewing more binding descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenburns committed Sep 26, 2024
1 parent 808994d commit 1ab1299
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/textual/widgets/_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class Button(Widget, can_focus=True):
}
"""

BINDINGS = [Binding("enter", "press", "Press Button", show=False)]
BINDINGS = [Binding("enter", "press", "Press button", show=False)]

label: reactive[TextType] = reactive[TextType]("")
"""The text label that appears within the button."""
Expand Down
12 changes: 6 additions & 6 deletions src/textual/widgets/_data_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,12 @@ class DataTable(ScrollView, Generic[CellType], can_focus=True):

BINDINGS: ClassVar[list[BindingType]] = [
Binding("enter", "select_cursor", "Select", show=False),
Binding("up", "cursor_up", "Cursor Up", show=False),
Binding("down", "cursor_down", "Cursor Down", show=False),
Binding("right", "cursor_right", "Cursor Right", show=False),
Binding("left", "cursor_left", "Cursor Left", show=False),
Binding("pageup", "page_up", "Page Up", show=False),
Binding("pagedown", "page_down", "Page Down", show=False),
Binding("up", "cursor_up", "Cursor up", show=False),
Binding("down", "cursor_down", "Cursor down", show=False),
Binding("right", "cursor_right", "Cursor right", show=False),
Binding("left", "cursor_left", "Cursor left", show=False),
Binding("pageup", "page_up", "Page up", show=False),
Binding("pagedown", "page_down", "Page down", show=False),
Binding("ctrl+home", "scroll_top", "Top", show=False),
Binding("ctrl+end", "scroll_bottom", "Bottom", show=False),
Binding("home", "scroll_home", "Home", show=False),
Expand Down
4 changes: 2 additions & 2 deletions src/textual/widgets/_list_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class ListView(VerticalScroll, can_focus=True, can_focus_children=False):

BINDINGS: ClassVar[list[BindingType]] = [
Binding("enter", "select_cursor", "Select", show=False),
Binding("up", "cursor_up", "Cursor Up", show=False),
Binding("down", "cursor_down", "Cursor Down", show=False),
Binding("up", "cursor_up", "Cursor up", show=False),
Binding("down", "cursor_down", "Cursor down", show=False),
]
"""
| Key(s) | Description |
Expand Down
4 changes: 2 additions & 2 deletions src/textual/widgets/_option_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ class OptionList(ScrollView, can_focus=True):
Binding("end", "last", "Last", show=False),
Binding("enter", "select", "Select", show=False),
Binding("home", "first", "First", show=False),
Binding("pagedown", "page_down", "Page Down", show=False),
Binding("pageup", "page_up", "Page Up", show=False),
Binding("pagedown", "page_down", "Page down", show=False),
Binding("pageup", "page_up", "Page up", show=False),
Binding("up", "cursor_up", "Up", show=False),
]
"""
Expand Down
2 changes: 1 addition & 1 deletion src/textual/widgets/_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class EmptySelectError(Exception):
class SelectOverlay(OptionList):
"""The 'pop-up' overlay for the Select control."""

BINDINGS = [("escape", "dismiss")]
BINDINGS = [("escape", "dismiss", "Dismiss menu")]

DEFAULT_CSS = """
SelectOverlay {
Expand Down
2 changes: 1 addition & 1 deletion src/textual/widgets/_selection_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def initial_state(self) -> bool:
class SelectionList(Generic[SelectionType], OptionList):
"""A vertical selection list that allows making multiple selections."""

BINDINGS = [Binding("space", "select")]
BINDINGS = [Binding("space", "select", "Toggle option")]
"""
| Key(s) | Description |
| :- | :- |
Expand Down
54 changes: 27 additions & 27 deletions src/textual/widgets/_text_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,63 +167,63 @@ class TextArea(ScrollView):

BINDINGS = [
# Cursor movement
Binding("up", "cursor_up", "cursor up", show=False),
Binding("down", "cursor_down", "cursor down", show=False),
Binding("left", "cursor_left", "cursor left", show=False),
Binding("right", "cursor_right", "cursor right", show=False),
Binding("ctrl+left", "cursor_word_left", "cursor word left", show=False),
Binding("ctrl+right", "cursor_word_right", "cursor word right", show=False),
Binding("home,ctrl+a", "cursor_line_start", "cursor line start", show=False),
Binding("end,ctrl+e", "cursor_line_end", "cursor line end", show=False),
Binding("pageup", "cursor_page_up", "cursor page up", show=False),
Binding("pagedown", "cursor_page_down", "cursor page down", show=False),
Binding("up", "cursor_up", "Cursor up", show=False),
Binding("down", "cursor_down", "Cursor down", show=False),
Binding("left", "cursor_left", "Cursor left", show=False),
Binding("right", "cursor_right", "Cursor right", show=False),
Binding("ctrl+left", "cursor_word_left", "Cursor word left", show=False),
Binding("ctrl+right", "cursor_word_right", "Cursor word right", show=False),
Binding("home,ctrl+a", "cursor_line_start", "Cursor line start", show=False),
Binding("end,ctrl+e", "cursor_line_end", "Cursor line end", show=False),
Binding("pageup", "cursor_page_up", "Cursor page up", show=False),
Binding("pagedown", "cursor_page_down", "Cursor page down", show=False),
# Making selections (generally holding the shift key and moving cursor)
Binding(
"ctrl+shift+left",
"cursor_word_left(True)",
"cursor left word select",
"Cursor left word select",
show=False,
),
Binding(
"ctrl+shift+right",
"cursor_word_right(True)",
"cursor right word select",
"Cursor right word select",
show=False,
),
Binding(
"shift+home",
"cursor_line_start(True)",
"cursor line start select",
"Cursor line start select",
show=False,
),
Binding(
"shift+end", "cursor_line_end(True)", "cursor line end select", show=False
"shift+end", "cursor_line_end(True)", "Cursor line end select", show=False
),
Binding("shift+up", "cursor_up(True)", "cursor up select", show=False),
Binding("shift+down", "cursor_down(True)", "cursor down select", show=False),
Binding("shift+left", "cursor_left(True)", "cursor left select", show=False),
Binding("shift+right", "cursor_right(True)", "cursor right select", show=False),
Binding("shift+up", "cursor_up(True)", "Cursor up select", show=False),
Binding("shift+down", "cursor_down(True)", "Cursor down select", show=False),
Binding("shift+left", "cursor_left(True)", "Cursor left select", show=False),
Binding("shift+right", "cursor_right(True)", "Cursor right select", show=False),
# Shortcut ways of making selections
# Binding("f5", "select_word", "select word", show=False),
Binding("f6", "select_line", "select line", show=False),
Binding("f7", "select_all", "select all", show=False),
Binding("f6", "select_line", "Select line", show=False),
Binding("f7", "select_all", "Select all", show=False),
# Deletion
Binding("backspace", "delete_left", "delete left", show=False),
Binding("backspace", "delete_left", "Delete character left", show=False),
Binding(
"ctrl+w", "delete_word_left", "delete left to start of word", show=False
"ctrl+w", "delete_word_left", "Delete left to start of word", show=False
),
Binding("delete,ctrl+d", "delete_right", "delete right", show=False),
Binding("delete,ctrl+d", "delete_right", "Delete character right", show=False),
Binding(
"ctrl+f", "delete_word_right", "delete right to start of word", show=False
"ctrl+f", "delete_word_right", "Delete right to start of word", show=False
),
Binding("ctrl+x", "delete_line", "delete line", show=False),
Binding("ctrl+x", "delete_line", "Delete line", show=False),
Binding(
"ctrl+u", "delete_to_start_of_line", "delete to line start", show=False
"ctrl+u", "delete_to_start_of_line", "Delete to line start", show=False
),
Binding(
"ctrl+k",
"delete_to_end_of_line_or_delete_line",
"delete to line end",
"Delete to line end",
show=False,
),
Binding("ctrl+z", "undo", "Undo", show=False),
Expand Down

0 comments on commit 1ab1299

Please sign in to comment.