From 3926423093811e3696c2c837308081ecec8c39b4 Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Mon, 11 Mar 2024 12:46:01 +0000 Subject: [PATCH] Simplify user list Go back to a simple vbox --- usr/lib/jargonaut/jargonaut.py | 12 -- .../schemas/org.x.jargonaut.gschema.xml | 5 - usr/share/jargonaut/jargonaut.ui | 104 ++++++------------ 3 files changed, 34 insertions(+), 87 deletions(-) diff --git a/usr/lib/jargonaut/jargonaut.py b/usr/lib/jargonaut/jargonaut.py index bbaf8bb..d3e157e 100755 --- a/usr/lib/jargonaut/jargonaut.py +++ b/usr/lib/jargonaut/jargonaut.py @@ -137,7 +137,6 @@ def do_activate(self): self.user_treeview.set_model(self.user_store) self.user_store.set_sort_column_id(1, Gtk.SortType.ASCENDING) - self.user_list_sw = self.builder.get_object("treeview_users_sw") self.user_list_box = self.builder.get_object("user_list_box") self.user_list_box.set_visible(self.settings.get_boolean("user-list-visible")) self.current_paned_position = 0 @@ -283,7 +282,6 @@ def on_join(self, connection, event): self.update_users() if nick == self.nickname: self.builder.get_object("main_stack").set_visible_child_name("page_chat") - self.size_user_list() self.entry.grab_focus() self.identify(connection) else: @@ -576,12 +574,6 @@ def is_window_focused(self): focused = self.window.is_active() and self.window.get_visible() return focused - @idle - def size_user_list(self): - stored_sidebar_width = self.settings.get_int("sidebar-width") - paned_max = self.chat_paned.props.max_position - self.chat_paned.set_position(paned_max + self.user_list_sw.get_min_content_width() - stored_sidebar_width) - def on_back_button_clicked(self, widget): self.builder.get_object("main_stack").set_visible_child_name("page_chat") self.builder.get_object("back_button").set_visible(False) @@ -683,10 +675,6 @@ def do_shutdown(self): if self.is_connected: self.disconnect() - # 50 is our minimum content width for the user list scrolled window, - # so that needs to be accounted for, because max_position is affected by it. - saved_width = self.chat_paned.props.max_position + self.user_list_sw.get_min_content_width() - self.chat_paned.get_position() - self.settings.set_int("sidebar-width", saved_width) Gtk.Application.do_shutdown(self) app = App() diff --git a/usr/share/glib-2.0/schemas/org.x.jargonaut.gschema.xml b/usr/share/glib-2.0/schemas/org.x.jargonaut.gschema.xml index a2aa6e3..7d7cb5b 100644 --- a/usr/share/glib-2.0/schemas/org.x.jargonaut.gschema.xml +++ b/usr/share/glib-2.0/schemas/org.x.jargonaut.gschema.xml @@ -29,10 +29,5 @@ false Whether to print debug information to stdout - - - 150 - - diff --git a/usr/share/jargonaut/jargonaut.ui b/usr/share/jargonaut/jargonaut.ui index 4ae68af..2e25cd2 100644 --- a/usr/share/jargonaut/jargonaut.ui +++ b/usr/share/jargonaut/jargonaut.ui @@ -1,5 +1,5 @@ - + @@ -102,98 +102,62 @@ True False - + True - True - 300 - True - True + False + vertical + + + + + + True + True + 0 + + + + + True + False - + True False - - - True - False - vertical - - - - - - True - True - 0 - - - - - True - False - - - False - True - 1 - - - True - True + False + True + 0 - + True - False - True + True + 150 - - True - False - - - False - True - 0 - - - - + True True - True - 50 - - - True - True - False - - - - + False + + - - True - True - 1 - - True - False + False + True + 1 - True + False True - 0 + 1