mirror of
https://github.com/markqvist/NomadNet.git
synced 2026-10-26 19:01:44 -04:00
Made gutters configurable
This commit is contained in:
parent
057f24674f
commit
1fb7ed5b8d
3 changed files with 29 additions and 8 deletions
|
|
@ -162,6 +162,7 @@ class NomadNetworkApp:
|
|||
self.rrc_ui_space_msgs = False
|
||||
self.rrc_ui_render_markdown = True
|
||||
self.rrc_ui_render_micron = True
|
||||
self.rrc_show_gutters = False
|
||||
|
||||
if not os.path.isdir(self.storagepath):
|
||||
os.makedirs(self.storagepath)
|
||||
|
|
@ -1028,6 +1029,11 @@ class NomadNetworkApp:
|
|||
try: value = self.config["rrc"].as_bool(option)
|
||||
except Exception: value = True
|
||||
self.rrc_ui_render_micron = value
|
||||
|
||||
if option == "show_gutters":
|
||||
try: value = self.config["rrc"].as_bool(option)
|
||||
except Exception: value = False
|
||||
self.rrc_show_gutters = value
|
||||
|
||||
if "node" in self.config:
|
||||
if not "enable_node" in self.config["node"]:
|
||||
|
|
@ -1374,6 +1380,7 @@ render_micron = yes
|
|||
nick_colors = yes
|
||||
justify_msgs = yes
|
||||
space_msgs = no
|
||||
show_gutters = yes
|
||||
|
||||
# You can configure your own color theme
|
||||
# for nick color assignment
|
||||
|
|
|
|||
|
|
@ -551,6 +551,7 @@ class RoomWidget(urwid.WidgetWrap):
|
|||
self.users_box = UsersBox(self.users_listbox, title="Users")
|
||||
self.users_box.delegate = self
|
||||
self.users_gutter = UsersExpandGutter(self.app, self)
|
||||
self.show_gutters = self.app.rrc_show_gutters
|
||||
self._refresh_users_pane()
|
||||
|
||||
self.users_visible = self.display.users_visible
|
||||
|
|
@ -570,10 +571,16 @@ class RoomWidget(urwid.WidgetWrap):
|
|||
(self.users_box, self.columns.options(urwid.GIVEN, RoomWidget.USERS_PANE_WIDTH)),
|
||||
]
|
||||
else:
|
||||
self.columns.contents = [
|
||||
(self.chat_box, self.columns.options(urwid.WEIGHT, 1)),
|
||||
(self.users_gutter, self.columns.options(urwid.GIVEN, 1)),
|
||||
]
|
||||
if self.show_gutters:
|
||||
self.columns.contents = [
|
||||
(self.chat_box, self.columns.options(urwid.WEIGHT, 1)),
|
||||
(self.users_gutter, self.columns.options(urwid.GIVEN, 1)),
|
||||
]
|
||||
else:
|
||||
self.columns.contents = [
|
||||
(self.chat_box, self.columns.options(urwid.WEIGHT, 1))
|
||||
]
|
||||
|
||||
self.columns.focus_position = 0
|
||||
|
||||
def _refresh_users_pane(self):
|
||||
|
|
@ -1263,6 +1270,7 @@ class ChannelsDisplay():
|
|||
|
||||
self._build_listbox()
|
||||
self.gutter = ChannelsExpandGutter(self.app, self)
|
||||
self.show_gutters = self.app.rrc_show_gutters
|
||||
|
||||
self.list_shortcuts = ChannelsListShortcuts(self.app)
|
||||
self.room_shortcuts = ChannelsRoomShortcuts(self.app)
|
||||
|
|
@ -1323,10 +1331,15 @@ class ChannelsDisplay():
|
|||
try: self.columns_widget.focus_position = 1
|
||||
except Exception: pass
|
||||
else:
|
||||
self.columns_widget.contents = [
|
||||
(self.gutter, gutter_opts),
|
||||
(self.right, right_opts),
|
||||
]
|
||||
if self.show_gutters:
|
||||
self.columns_widget.contents = [
|
||||
(self.gutter, gutter_opts),
|
||||
(self.right, right_opts),
|
||||
]
|
||||
else:
|
||||
self.columns_widget.contents = [
|
||||
(self.right, right_opts),
|
||||
]
|
||||
try: self.columns_widget.focus_position = 1
|
||||
except Exception: pass
|
||||
|
||||
|
|
|
|||
|
|
@ -986,6 +986,7 @@ Whether or not to render RRC nicks in distinct colors based on identity hash.
|
|||
>>>
|
||||
`!justify_msgs = yes`!
|
||||
`!space_msgs = no`!
|
||||
`!show_gutters = no`!
|
||||
>>>>
|
||||
Rendering layout options for messages.
|
||||
<
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue