Dont use hide() after show_all()

rather use no_show_all. This reduces flickering when we show the window
This commit is contained in:
Philipp Hörist 2018-08-18 00:48:12 +02:00
parent 042d8aa687
commit 1bb04ca402
2 changed files with 14 additions and 20 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.0 --> <!-- Generated with glade 3.22.1 -->
<interface> <interface>
<requires lib="gtk+" version="3.20"/> <requires lib="gtk+" version="3.20"/>
<object class="GtkListStore" id="account_liststore"> <object class="GtkListStore" id="account_liststore">
@ -48,8 +48,8 @@
<property name="baseline_position">top</property> <property name="baseline_position">top</property>
<child> <child>
<object class="GtkLabel" id="prompt_label"> <object class="GtkLabel" id="prompt_label">
<property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="halign">center</property> <property name="halign">center</property>
<property name="margin_top">18</property> <property name="margin_top">18</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
@ -94,7 +94,7 @@
<property name="halign">end</property> <property name="halign">end</property>
<property name="label" translatable="yes">_Nickname</property> <property name="label" translatable="yes">_Nickname</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="xalign">0.03999999910593033</property> <property name="xalign">0.5</property>
<style> <style>
<class name="dim-label"/> <class name="dim-label"/>
</style> </style>
@ -167,8 +167,8 @@
</child> </child>
<child> <child>
<object class="GtkLabel" id="account_label"> <object class="GtkLabel" id="account_label">
<property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="halign">end</property> <property name="halign">end</property>
<property name="margin_bottom">12</property> <property name="margin_bottom">12</property>
<property name="label" translatable="yes">A_ccount</property> <property name="label" translatable="yes">A_ccount</property>
@ -184,8 +184,8 @@
</child> </child>
<child> <child>
<object class="GtkLabel" id="protocol_label"> <object class="GtkLabel" id="protocol_label">
<property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="halign">end</property> <property name="halign">end</property>
<property name="label" translatable="yes">_Protocol</property> <property name="label" translatable="yes">_Protocol</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
@ -206,8 +206,8 @@
<property name="spacing">12</property> <property name="spacing">12</property>
<child> <child>
<object class="GtkComboBox" id="protocol_combobox"> <object class="GtkComboBox" id="protocol_combobox">
<property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="model">protocol</property> <property name="model">protocol</property>
<signal name="changed" handler="on_protocol_combobox_changed" swapped="no"/> <signal name="changed" handler="on_protocol_combobox_changed" swapped="no"/>
<child> <child>
@ -233,7 +233,6 @@
</child> </child>
<child> <child>
<object class="GtkComboBox" id="protocol_jid_combobox"> <object class="GtkComboBox" id="protocol_jid_combobox">
<property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="no_show_all">True</property> <property name="no_show_all">True</property>
<property name="model">protocol_jid</property> <property name="model">protocol_jid</property>
@ -259,8 +258,8 @@
</child> </child>
<child> <child>
<object class="GtkComboBox" id="account_combobox"> <object class="GtkComboBox" id="account_combobox">
<property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="margin_bottom">12</property> <property name="margin_bottom">12</property>
<property name="model">account_liststore</property> <property name="model">account_liststore</property>
<property name="entry_text_column">1</property> <property name="entry_text_column">1</property>

View File

@ -168,25 +168,18 @@ class AddNewContactWindow(Gtk.ApplicationWindow):
self.group_comboboxentry.set_active(i) self.group_comboboxentry.set_active(i)
i += 1 i += 1
self.show_all()
self.prompt_label.hide()
self.save_message_revealer.hide()
if len(accounts) > 1: if len(accounts) > 1:
liststore = self.account_combobox.get_model() liststore = self.account_combobox.get_model()
for acc in accounts: for acc in accounts:
liststore.append(acc) liststore.append(acc)
self.account_combobox.set_active_id(self.account) self.account_combobox.set_active_id(self.account)
else: self.account_label.show()
self.account_label.hide() self.account_combobox.show()
self.account_combobox.hide()
if len(self.agents) == 1: if len(self.agents) > 1:
self.protocol_label.hide() self.protocol_label.show()
self.protocol_combobox.hide() self.protocol_combobox.show()
self.protocol_jid_combobox.hide()
if self.account: if self.account:
message_buffer = self.message_textview.get_buffer() message_buffer = self.message_textview.get_buffer()
@ -194,6 +187,8 @@ class AddNewContactWindow(Gtk.ApplicationWindow):
self.account)) self.account))
message_buffer.set_text(msg) message_buffer.set_text(msg)
self.show_all()
app.ged.register_event_handler('gateway-prompt-received', ged.GUI1, app.ged.register_event_handler('gateway-prompt-received', ged.GUI1,
self._nec_gateway_prompt_received) self._nec_gateway_prompt_received)
app.ged.register_event_handler('presence-received', ged.GUI1, app.ged.register_event_handler('presence-received', ged.GUI1,