From 1fb7ed5b8d1f9f813f8b3126e8484d0d191054b9 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 21 May 2026 02:24:13 +0200 Subject: [PATCH] Made gutters configurable --- nomadnet/NomadNetworkApp.py | 7 +++++++ nomadnet/ui/textui/Channels.py | 29 +++++++++++++++++++++-------- nomadnet/ui/textui/Guide.py | 1 + 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/nomadnet/NomadNetworkApp.py b/nomadnet/NomadNetworkApp.py index 97bdb28..31154a0 100644 --- a/nomadnet/NomadNetworkApp.py +++ b/nomadnet/NomadNetworkApp.py @@ -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 diff --git a/nomadnet/ui/textui/Channels.py b/nomadnet/ui/textui/Channels.py index 687ce96..8e82435 100644 --- a/nomadnet/ui/textui/Channels.py +++ b/nomadnet/ui/textui/Channels.py @@ -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 diff --git a/nomadnet/ui/textui/Guide.py b/nomadnet/ui/textui/Guide.py index 561468c..19cee6c 100644 --- a/nomadnet/ui/textui/Guide.py +++ b/nomadnet/ui/textui/Guide.py @@ -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. <