Philipp Hörist pushed to branch master at gajim / gajim
Commits: e9abf7b6 by lovetox at 2020-08-14T09:32:31+02:00 StatusSelector: Hide when there are no accounts
- - - - -
3 changed files:
- gajim/gtk/status_selector.py - gajim/gui_interface.py - gajim/roster_window.py
Changes:
===================================== gajim/gtk/status_selector.py ===================================== @@ -30,6 +30,7 @@ class StatusSelector(Gtk.MenuButton): self.set_direction(Gtk.ArrowType.UP) self._compact = compact self._create_popover() + self.set_no_show_all(True)
self._current_show_icon = Gtk.Image() self._current_show_icon.set_from_icon_name( @@ -43,6 +44,7 @@ class StatusSelector(Gtk.MenuButton): self._current_show_label.set_halign(Gtk.Align.START) self._current_show_label.set_xalign(0) box.add(self._current_show_label) + box.show_all() self.add(box)
def _create_popover(self): @@ -106,6 +108,11 @@ class StatusSelector(Gtk.MenuButton): app.interface.change_status(status=new_status)
def update(self): + if not app.connections: + self.hide() + return + + self.show() show = get_global_show() uf_show = get_uf_show(show) self._current_show_icon.set_from_icon_name(
===================================== gajim/gui_interface.py ===================================== @@ -1638,6 +1638,7 @@ class Interface: app.config.set_per( 'accounts', account, 'roster_version', '') self.roster.setup_and_draw_roster() + self.roster.update_status_selector() gui_menu_builder.build_accounts_menu() app.config.set_per('accounts', account, 'active', False) app.app.update_app_actions_state()
===================================== gajim/roster_window.py ===================================== @@ -1446,6 +1446,8 @@ class RosterWindow: # Recalculate column width for ellipsizing self.tree.columns_autosize()
+ def update_status_selector(self): + self._status_selector.update()
def select_contact(self, jid, account): """
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/e9abf7b6093c743854cde1e9a4f136282...