From 1bb04ca402fc96b710cab31ec5d346349ca5cacf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Sat, 18 Aug 2018 00:48:12 +0200 Subject: [PATCH] Dont use hide() after show_all() rather use no_show_all. This reduces flickering when we show the window --- gajim/data/gui/add_new_contact_window.ui | 15 +++++++-------- gajim/gtk/add_contact.py | 19 +++++++------------ 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/gajim/data/gui/add_new_contact_window.ui b/gajim/data/gui/add_new_contact_window.ui index 3b873d444..3a7c5eee5 100644 --- a/gajim/data/gui/add_new_contact_window.ui +++ b/gajim/data/gui/add_new_contact_window.ui @@ -1,5 +1,5 @@ - + @@ -48,8 +48,8 @@ top - True False + True center 18 True @@ -94,7 +94,7 @@ end _Nickname True - 0.03999999910593033 + 0.5 @@ -167,8 +167,8 @@ - True False + True end 12 A_ccount @@ -184,8 +184,8 @@ - True False + True end _Protocol True @@ -206,8 +206,8 @@ 12 - True False + True protocol @@ -233,7 +233,6 @@ - True False True protocol_jid @@ -259,8 +258,8 @@ - True False + True 12 account_liststore 1 diff --git a/gajim/gtk/add_contact.py b/gajim/gtk/add_contact.py index 6609cbf6f..3fc53719d 100644 --- a/gajim/gtk/add_contact.py +++ b/gajim/gtk/add_contact.py @@ -168,25 +168,18 @@ class AddNewContactWindow(Gtk.ApplicationWindow): self.group_comboboxentry.set_active(i) i += 1 - self.show_all() - - self.prompt_label.hide() - self.save_message_revealer.hide() - if len(accounts) > 1: liststore = self.account_combobox.get_model() for acc in accounts: liststore.append(acc) self.account_combobox.set_active_id(self.account) - else: - self.account_label.hide() - self.account_combobox.hide() + self.account_label.show() + self.account_combobox.show() - if len(self.agents) == 1: - self.protocol_label.hide() - self.protocol_combobox.hide() - self.protocol_jid_combobox.hide() + if len(self.agents) > 1: + self.protocol_label.show() + self.protocol_combobox.show() if self.account: message_buffer = self.message_textview.get_buffer() @@ -194,6 +187,8 @@ class AddNewContactWindow(Gtk.ApplicationWindow): self.account)) message_buffer.set_text(msg) + self.show_all() + app.ged.register_event_handler('gateway-prompt-received', ged.GUI1, self._nec_gateway_prompt_received) app.ged.register_event_handler('presence-received', ged.GUI1,