Philipp Hörist pushed to branch master at gajim / gajim

Commits:
1bb04ca4 by Philipp Hörist at 2018-08-17T22:48:12Z
Dont use hide() after show_all()

rather use no_show_all. This reduces flickering when we show the window

- - - - -


2 changed files:

- gajim/data/gui/add_new_contact_window.ui
- gajim/gtk/add_contact.py


Changes:

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


=====================================
gajim/gtk/add_contact.py
=====================================
--- 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,



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/1bb04ca402fc96b710cab31ec5d346349ca5cacf

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/1bb04ca402fc96b710cab31ec5d346349ca5cacf
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to