[gnome-control-center] printers: Redesign loading page in the "Add Printer" dialog



commit 116f7638316cce3338255e425fac996a71483686
Author: Felipe Borges <felipeborges gnome org>
Date:   Fri Sep 2 14:00:37 2016 +0200

    printers: Redesign loading page in the "Add Printer" dialog
    
    This is a redesign based on the newest mockups available at
    https://wiki.gnome.org/Design/SystemSettings/Printers#Guidelines
    
    The spinner is displayed while search is taking place AND nothing
    has been found. Ongoing search is indicated by the sub-heading.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760783

 panels/printers/new-printer-dialog.ui   |   72 +++++++++++--------------------
 panels/printers/pp-new-printer-dialog.c |   12 ++---
 2 files changed, 31 insertions(+), 53 deletions(-)
---
diff --git a/panels/printers/new-printer-dialog.ui b/panels/printers/new-printer-dialog.ui
index dc1f261..418a28b 100644
--- a/panels/printers/new-printer-dialog.ui
+++ b/panels/printers/new-printer-dialog.ui
@@ -33,7 +33,7 @@
     <property name="type_hint">dialog</property>
     <property name="use_header_bar">1</property>
     <child internal-child="headerbar">
-      <object class="GtkHeaderBar">
+      <object class="GtkHeaderBar" id="headerbar">
         <property name="visible">True</property>
         <property name="show-close-button">False</property>
         <child>
@@ -103,7 +103,7 @@
             <child>
               <object class="GtkStack" id="stack">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
+                <property name="can_focus">True</property>
                 <property name="transition-type">none</property>
                 <style>
                   <class name="view"/>
@@ -143,6 +143,7 @@
                         <property name="valign">GTK_ALIGN_START</property>
                         <property name="pixel_size">72</property>
                         <property name="icon_name">printer-symbolic</property>
+                        <property name="opacity">0.6</property>
                         <style>
                           <class name="dim-label"/>
                         </style>
@@ -159,6 +160,7 @@
                         <property name="can_focus">False</property>
                         <property name="sensitive">False</property>
                         <property name="label" translatable="yes" comments="Translators: No printers were 
detected">No Printers Found</property>
+                        <property name="opacity">0.6</property>
                         <attributes>
                           <attribute name="weight" value="bold"/>
                         </attributes>
@@ -169,6 +171,26 @@
                     <property name="name">no-printers-page</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkBox">
+                    <property name="visible">True</property>
+                    <style>
+                      <class name="view"/>
+                    </style>
+                    <child>
+                      <object class="GtkSpinner" id="spinner">
+                        <property name="visible">True</property>
+                        <property name="active">True</property>
+                        <property name="expand">True</property>
+                        <property name="sensitive">False</property>
+                        <property name="opacity">0.6</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="name">loading-page</property>
+                  </packing>
+                </child>
               </object>
               <packing>
                 <property name="expand">True</property>
@@ -203,25 +225,6 @@
                         <property name="can_focus">False</property>
                         <property name="border_width">4</property>
                         <child>
-                          <object class="GtkFixed" id="fixed">
-                            <property name="width_request">24</property>
-                            <property name="height_request">24</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="halign">center</property>
-                            <property name="valign">center</property>
-                            <child>
-                              <placeholder/>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="padding">10</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
                           <object class="GtkSearchEntry" id="search-entry">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
@@ -230,6 +233,8 @@
                             <property name="truncate_multiline">True</property>
                             <property name="invisible_char_set">True</property>
                             <property name="placeholder_text" translatable="yes" comments="Translators: The 
entered text should contain network address of a printer or a text which will filter found devices (their 
names and locations)">Enter a network address or search for a printer</property>
+                            <property name="margin_start">40</property>
+                            <property name="margin_end">40</property>
                           </object>
                           <packing>
                             <property name="expand">True</property>
@@ -237,31 +242,6 @@
                             <property name="position">1</property>
                           </packing>
                         </child>
-                        <child>
-                          <object class="GtkFixed" id="fixed1">
-                            <property name="width_request">24</property>
-                            <property name="height_request">24</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="halign">center</property>
-                            <property name="valign">center</property>
-                            <child>
-                              <object class="GtkSpinner" id="spinner">
-                                <property name="width_request">24</property>
-                                <property name="height_request">24</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="no_show_all">True</property>
-                              </object>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="padding">10</property>
-                            <property name="position">2</property>
-                          </packing>
-                        </child>
                       </object>
                     </child>
                   </object>
diff --git a/panels/printers/pp-new-printer-dialog.c b/panels/printers/pp-new-printer-dialog.c
index 4484ec3..d154bdb 100644
--- a/panels/printers/pp-new-printer-dialog.c
+++ b/panels/printers/pp-new-printer-dialog.c
@@ -712,7 +712,7 @@ update_dialog_state (PpNewPrinterDialog *dialog)
 {
   PpNewPrinterDialogPrivate *priv = dialog->priv;
   GtkTreeIter                iter;
-  GtkWidget                 *spinner;
+  GtkWidget                 *header;
   GtkWidget                 *stack;
   gboolean                   searching;
 
@@ -725,24 +725,22 @@ update_dialog_state (PpNewPrinterDialog *dialog)
               priv->samba_authenticated_searching ||
               priv->samba_searching;
 
-  spinner = WID ("spinner");
+  header = WID ("headerbar");
   stack = WID ("stack");
 
   if (searching)
     {
-      gtk_spinner_start (GTK_SPINNER (spinner));
-      gtk_widget_show (spinner);
+      gtk_header_bar_set_subtitle (GTK_HEADER_BAR (header), _("Searching for Printers"));
     }
   else
     {
-      gtk_spinner_stop (GTK_SPINNER (spinner));
-      gtk_widget_hide (spinner);
+      gtk_header_bar_set_subtitle (GTK_HEADER_BAR (header), NULL);
     }
 
   if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->store), &iter) && !searching)
     gtk_stack_set_visible_child_name (GTK_STACK (stack), "no-printers-page");
   else
-    gtk_stack_set_visible_child_name (GTK_STACK (stack), "standard-page");
+      gtk_stack_set_visible_child_name (GTK_STACK (stack), searching ? "loading-page": "standard-page");
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]