Add even more config options
This commit is contained in:
parent
f3bbd42420
commit
cd90649111
2 changed files with 81 additions and 10 deletions
|
|
@ -120,11 +120,51 @@ class EuphConfig(TransparentConfig):
|
||||||
def indent_cursor_style(self) -> str:
|
def indent_cursor_style(self) -> str:
|
||||||
return self["visual.indent.cursor.style"]
|
return self["visual.indent.cursor.style"]
|
||||||
|
|
||||||
# other
|
# scroll
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def scrolloff(self) -> int:
|
def scrolloff(self) -> int:
|
||||||
return self["visual.scrolloff"]
|
return self["visual.scroll.scrolloff"]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def vertical_scroll(self) -> int:
|
||||||
|
return self["visual.scroll.vertical"]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def horizontal_scroll(self) -> int:
|
||||||
|
return self["visual.scroll.horizontal"]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def half_page_scroll(self) -> bool:
|
||||||
|
return self["visual.scroll.half_page"]
|
||||||
|
|
||||||
|
# borders
|
||||||
|
|
||||||
|
@property
|
||||||
|
def room_name_separator(self) -> str:
|
||||||
|
return self["visual.borders.room_name_separator"]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def room_name_split(self) -> str:
|
||||||
|
return self["visual.borders.room_name_split"]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def nick_list_separator(self) -> str:
|
||||||
|
return self["visual.borders.nick_list_separator"]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def nick_list_split(self) -> str:
|
||||||
|
return self["visual.borders.nick_list_split"]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def edit_separator(self) -> str:
|
||||||
|
return self["visual.borders.edit_separator"]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def borders_style(self) -> str:
|
||||||
|
return self["visual.borders.style"]
|
||||||
|
|
||||||
|
# other
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def palette(self) -> Any:
|
def palette(self) -> Any:
|
||||||
|
|
@ -176,8 +216,10 @@ class EuphLoader(TreeLoader):
|
||||||
self.add_style("visual.surround.style", "bold")
|
self.add_style("visual.surround.style", "bold")
|
||||||
|
|
||||||
# cursor
|
# cursor
|
||||||
self.add("visual.cursor.surround.left", Kind.STR, "<", self.SINGLE_CHAR)
|
self.add("visual.cursor.surround.left", Kind.STR, "<",
|
||||||
self.add("visual.cursor.surround.right", Kind.STR, ">", self.SINGLE_CHAR)
|
self.SINGLE_CHAR)
|
||||||
|
self.add("visual.cursor.surround.right", Kind.STR, ">",
|
||||||
|
self.SINGLE_CHAR)
|
||||||
self.add_style("visual.cursor.surround.style", "cursor")
|
self.add_style("visual.cursor.surround.style", "cursor")
|
||||||
self.add_style("visual.cursor.own_nick_style", "cursor")
|
self.add_style("visual.cursor.own_nick_style", "cursor")
|
||||||
self.add("visual.cursor.fill.char", Kind.STR, " ", self.SINGLE_CHAR)
|
self.add("visual.cursor.fill.char", Kind.STR, " ", self.SINGLE_CHAR)
|
||||||
|
|
@ -189,13 +231,31 @@ class EuphLoader(TreeLoader):
|
||||||
self.add("visual.indent.fill", Kind.STR, " ", self.SINGLE_CHAR)
|
self.add("visual.indent.fill", Kind.STR, " ", self.SINGLE_CHAR)
|
||||||
self.add_style("visual.indent.style", "gray")
|
self.add_style("visual.indent.style", "gray")
|
||||||
self.add("visual.indent.cursor.char", Kind.STR, "┃", self.SINGLE_CHAR)
|
self.add("visual.indent.cursor.char", Kind.STR, "┃", self.SINGLE_CHAR)
|
||||||
self.add("visual.indent.cursor.corner", Kind.STR, "┗", self.SINGLE_CHAR)
|
self.add("visual.indent.cursor.corner", Kind.STR, "┗",
|
||||||
|
self.SINGLE_CHAR)
|
||||||
self.add("visual.indent.cursor.fill", Kind.STR, "━", self.SINGLE_CHAR)
|
self.add("visual.indent.cursor.fill", Kind.STR, "━", self.SINGLE_CHAR)
|
||||||
self.add_style("visual.indent.cursor.style", "cursor")
|
self.add_style("visual.indent.cursor.style", "cursor")
|
||||||
|
|
||||||
# other
|
# scroll
|
||||||
self.add("visual.scrolloff", Kind.INT, 3, self.AT_LEAST_0)
|
self.add("visual.scroll.scrolloff", Kind.INT, 3, self.AT_LEAST_0)
|
||||||
|
self.add("visual.scroll.vertical", Kind.INT, 2, self.AT_LEAST_1)
|
||||||
|
self.add("visual.scroll.horizontal", Kind.INT, 8, self.AT_LEAST_1)
|
||||||
|
self.add("visual.scroll.half_page", Kind.BOOL, True)
|
||||||
|
|
||||||
|
# borders
|
||||||
|
self.add("visual.borders.room_name_separator", Kind.STR, "═",
|
||||||
|
self.SINGLE_CHAR)
|
||||||
|
self.add("visual.borders.room_name_split", Kind.STR, "╤",
|
||||||
|
self.SINGLE_CHAR)
|
||||||
|
self.add("visual.borders.nick_list_separator", Kind.STR, "│",
|
||||||
|
self.SINGLE_CHAR)
|
||||||
|
self.add("visual.borders.nick_list_split", Kind.STR, "┤",
|
||||||
|
self.SINGLE_CHAR)
|
||||||
|
self.add("visual.borders.edit_separator", Kind.STR, "─",
|
||||||
|
self.SINGLE_CHAR)
|
||||||
|
self.add_style("visual.borders.style", "gray")
|
||||||
|
|
||||||
|
# other
|
||||||
self.add("styles", Kind.DICT, self.DEFAULT_STYLES)
|
self.add("styles", Kind.DICT, self.DEFAULT_STYLES)
|
||||||
|
|
||||||
def add_style(self, name: str, default: str) -> None:
|
def add_style(self, name: str, default: str) -> None:
|
||||||
|
|
|
||||||
|
|
@ -287,7 +287,11 @@ class RoomWidget(urwid.WidgetWrap):
|
||||||
)
|
)
|
||||||
|
|
||||||
def _create_tree_widget(self) -> Any:
|
def _create_tree_widget(self) -> Any:
|
||||||
return CursorTreeWidget(self._tree)
|
return CursorTreeWidget(self._tree,
|
||||||
|
vertical_scroll_step=self.c.vertical_scroll,
|
||||||
|
horizontal_scroll_step=self.c.vertical_scroll,
|
||||||
|
half_page_scroll=self.c.half_page_scroll,
|
||||||
|
)
|
||||||
|
|
||||||
def _create_edit_widget(self) -> Any:
|
def _create_edit_widget(self) -> Any:
|
||||||
return urwid.Edit(multiline=True)
|
return urwid.Edit(multiline=True)
|
||||||
|
|
@ -301,10 +305,17 @@ class RoomWidget(urwid.WidgetWrap):
|
||||||
tree: Any,
|
tree: Any,
|
||||||
edit: Any,
|
edit: Any,
|
||||||
) -> Any:
|
) -> Any:
|
||||||
return RoomLayout(room_name, nick_list, tree, edit)
|
return RoomLayout(room_name, nick_list, tree, edit,
|
||||||
|
border_attrs={"style": self.c.borders_style},
|
||||||
|
room_name_separator=self.c.room_name_separator,
|
||||||
|
room_name_split=self.c.room_name_split,
|
||||||
|
nick_list_separator=self.c.nick_list_separator,
|
||||||
|
nick_list_split=self.c.nick_list_split,
|
||||||
|
edit_separator=self.c.edit_separator,
|
||||||
|
)
|
||||||
|
|
||||||
def _create_edit_nick_widget(self) -> Any:
|
def _create_edit_nick_widget(self) -> Any:
|
||||||
return EditWidget("Choose a nick: ", "@")
|
return EditWidget("Choose a nick: ", "@", style=self.c.own_nick_style)
|
||||||
|
|
||||||
## Room life cycle
|
## Room life cycle
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue