[gnome-software] Some tweaks to the appearance



commit 49ed6fbe1eee57be2a14da879375d1a1ef294d5d
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Aug 15 00:58:45 2013 -0400

    Some tweaks to the appearance
    
    Change the main view to use a header bar, and make the search
    entry appear as in the design. Some not-fleshed out interactive
    pieces have been removed from the ui file for now. They can
    come back later.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706049

 src/gnome-software.ui |  382 ++++++++++++++++++++-----------------------------
 src/gs-main.c         |   18 +--
 2 files changed, 160 insertions(+), 240 deletions(-)
---
diff --git a/src/gnome-software.ui b/src/gnome-software.ui
index b72ca67..c7fdfc6 100644
--- a/src/gnome-software.ui
+++ b/src/gnome-software.ui
@@ -25,7 +25,135 @@
   <object class="GtkWindow" id="window_software">
     <property name="can_focus">False</property>
     <property name="title" translatable="yes">Software</property>
-    <property name="hide_titlebar_when_maximized">True</property>
+    <child type="titlebar">
+      <object class="GtkHeaderBar" id="header">
+        <property name="visible">True</property>
+        <property name="show-close-button">True</property>
+        <child>
+          <object class="GtkButton" id="button_back">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <style>
+              <class name="image-button"/>
+            </style>
+            <child>
+              <object class="GtkImage" id="back_image">
+                <property name="visible">True</property>
+                <property name="icon-name">go-previous</property>
+                <property name="icon-size">1</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="pack-type">start</property>
+          </packing>
+        </child>
+        <child type="title">
+          <object class="GtkButtonBox" id="buttonbox_main">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="layout_style">center</property>
+            <style>
+              <class name="linked"/>
+            </style>
+            <child>
+              <object class="GtkToggleButton" id="button_new">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <style>
+                  <class name="toolbar-primary-buttons-software"/>
+                </style>
+                <child>
+                  <object class="GtkLabel" id="label_button_new">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">All</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkToggleButton" id="button_installed">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <style>
+                  <class name="toolbar-primary-buttons-software"/>
+                </style>
+                <child>
+                  <object class="GtkLabel" id="label_button_installed">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Installed</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkToggleButton" id="button_updates">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <style>
+                  <class name="toolbar-primary-buttons-software"/>
+                </style>
+                <child>
+                  <object class="GtkLabel" id="label_button_updates">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Updates</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton" id="button_update_all">
+            <property name="label" translatable="yes">Update All</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <style>
+              <class name="suggested-action"/>
+            </style>
+          </object>
+          <packing>
+            <property name="pack-type">end</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="button_install">
+            <property name="label" translatable="yes">Install</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <style>
+              <class name="suggested-action"/>
+            </style>
+          </object>
+          <packing>
+            <property name="pack-type">end</property>
+          </packing>
+        </child>
+      </object>
+    </child>
     <child>
       <object class="GtkBox" id="box1">
         <property name="visible">True</property>
@@ -33,37 +161,42 @@
         <property name="orientation">vertical</property>
         <property name="spacing">5</property>
         <child>
-          <object class="GtkToolbar" id="toolbar1">
+          <object class="GtkToolbar" id="search_bar">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="show_arrow">False</property>
+            <style>
+              <class name="primary-toolbar"/>
+            </style>
             <child>
-              <object class="GtkToolItem" id="toolitem1">
+              <object class="GtkToolItem" id="search_toolitem">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <child>
-                  <object class="GtkBox" id="box2">
+                  <object class="GtkBox" id="search_toolbox">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="spacing">21</property>
                     <child>
-                      <object class="GtkButton" id="button_back">
-                        <property name="label">gtk-go-back</property>
+                      <object class="GtkBox" id="box_left">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
-                        <property name="use_stock">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="orientation">vertical</property>
+                        <property name="halign">start</property>
+                        <property name="hexpand">True</property>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </object>
                       <packing>
-                        <property name="expand">False</property>
+                        <property name="expand">True</property>
                         <property name="fill">True</property>
                         <property name="position">0</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkLabel" id="label_update_all">
+                      <object class="GtkSearchEntry" id="entry_search">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
+                        <property name="can_focus">True</property>
+                        <property name="activates_default">True</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -72,78 +205,14 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkButtonBox" id="buttonbox_main">
+                      <object class="GtkBox" id="box_right">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="layout_style">center</property>
-                        <style>
-                          <class name="linked"/>
-                        </style>
-                        <child>
-                          <object class="GtkToggleButton" id="button_new">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <style>
-                              <class name="toolbar-primary-buttons-software"/>
-                            </style>
-                            <child>
-                              <object class="GtkLabel" id="label_button_new">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">New</property>
-                              </object>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkToggleButton" id="button_installed">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <style>
-                              <class name="toolbar-primary-buttons-software"/>
-                            </style>
-                            <child>
-                              <object class="GtkLabel" id="label_button_installed">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">Installed</property>
-                              </object>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
+                        <property name="orientation">vertical</property>
+                        <property name="halign">start</property>
+                        <property name="hexpand">True</property>
                         <child>
-                          <object class="GtkToggleButton" id="button_updates">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <style>
-                              <class name="toolbar-primary-buttons-software"/>
-                            </style>
-                            <child>
-                              <object class="GtkLabel" id="label_button_updates">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">Updates</property>
-                              </object>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">2</property>
-                          </packing>
+                          <placeholder/>
                         </child>
                       </object>
                       <packing>
@@ -152,122 +221,6 @@
                         <property name="position">2</property>
                       </packing>
                     </child>
-                    <child>
-                      <object class="GtkButtonBox" id="buttonbox_detail">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="layout_style">center</property>
-                        <style>
-                          <class name="linked"/>
-                        </style>
-                        <child>
-                          <object class="GtkToggleButton" id="button_overview">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <property name="active">True</property>
-                            <style>
-                              <class name="toolbar-primary-buttons-software"/>
-                            </style>
-                            <child>
-                              <object class="GtkLabel" id="label_button_overview">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">Overview</property>
-                              </object>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkToggleButton" id="button_reviews">
-                            <property name="visible">True</property>
-                            <property name="sensitive">False</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <style>
-                              <class name="toolbar-primary-buttons-software"/>
-                            </style>
-                            <child>
-                              <object class="GtkLabel" id="label_button_reviews">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">Reviews</property>
-                              </object>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkToggleButton" id="button_related">
-                            <property name="visible">True</property>
-                            <property name="sensitive">False</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <style>
-                              <class name="toolbar-primary-buttons-software"/>
-                            </style>
-                            <child>
-                              <object class="GtkLabel" id="label_button_related">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">Related</property>
-                              </object>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">2</property>
-                          </packing>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">True</property>
-                        <property name="fill">True</property>
-                        <property name="position">3</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkButton" id="button_install">
-                        <property name="label" translatable="yes">Install</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
-                        <style>
-                          <class name="suggested-action"/>
-                        </style>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">4</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkButton" id="button_update_all">
-                        <property name="label" translatable="yes">Update All</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
-                        <style>
-                          <class name="suggested-action"/>
-                        </style>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">5</property>
-                      </packing>
-                    </child>
                   </object>
                 </child>
               </object>
@@ -279,27 +232,6 @@
           <packing>
             <property name="expand">False</property>
             <property name="fill">True</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkSearchEntry" id="entry_search">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="margin_left">100</property>
-            <property name="margin_right">100</property>
-            <property name="invisible_char">●</property>
-            <property name="activates_default">True</property>
-            <property name="shadow_type">none</property>
-            <property name="caps_lock_warning">False</property>
-            <property name="progress_pulse_step">0.070000000298023224</property>
-            <property name="primary_icon_activatable">False</property>
-            <property name="primary_icon_sensitive">False</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
           </packing>
         </child>
         <child>
@@ -423,7 +355,7 @@
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
-                                <property name="label" translatable="yes">Popular</property>
+                                <property name="label" translatable="yes">Picks</property>
                               </object>
                             </child>
                           </object>
@@ -1023,11 +955,11 @@
     </child>
   </object>
   <object class="GtkSizeGroup" id="sizegroup_header_center"/>
-  <object class="GtkSizeGroup" id="sizegroup_header_edges">
-    <property name="mode">both</property>
+  <object class="GtkSizeGroup" id="sizegroup_searchentry">
+    <property name="mode">horizontal</property>
     <widgets>
-      <widget name="label_update_all"/>
-      <widget name="button_update_all"/>
+      <widget name="buttonbox_main"/>
+      <widget name="entry_search"/>
     </widgets>
   </object>
 </interface>
diff --git a/src/gs-main.c b/src/gs-main.c
index 1618d15..627bace 100644
--- a/src/gs-main.c
+++ b/src/gs-main.c
@@ -817,8 +817,6 @@ gs_main_set_overview_mode_ui (GsMainPrivate *priv, GsMainMode mode)
        case GS_MAIN_MODE_DETAILS:
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "buttonbox_main"));
                gtk_widget_set_visible (widget, FALSE);
-               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "buttonbox_detail"));
-               gtk_widget_set_visible (widget, TRUE);
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_back"));
                gtk_widget_set_visible (widget, TRUE);
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_install"));
@@ -832,8 +830,6 @@ gs_main_set_overview_mode_ui (GsMainPrivate *priv, GsMainMode mode)
        case GS_MAIN_MODE_WAITING:
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "buttonbox_main"));
                gtk_widget_set_visible (widget, TRUE);
-               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "buttonbox_detail"));
-               gtk_widget_set_visible (widget, FALSE);
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_back"));
                gtk_widget_set_visible (widget, FALSE);
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_install"));
@@ -859,10 +855,9 @@ gs_main_set_overview_mode_ui (GsMainPrivate *priv, GsMainMode mode)
        case GS_MAIN_MODE_NEW:
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_update_all"));
                gtk_widget_hide (widget);
-               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "label_update_all"));
-               gtk_widget_hide (widget);
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "entry_search"));
                gtk_entry_set_text (GTK_ENTRY (widget), "");
+               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "search_bar"));
                gtk_widget_show (widget);
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "spinner_waiting"));
                gtk_spinner_stop (GTK_SPINNER (widget));
@@ -870,10 +865,9 @@ gs_main_set_overview_mode_ui (GsMainPrivate *priv, GsMainMode mode)
        case GS_MAIN_MODE_INSTALLED:
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_update_all"));
                gtk_widget_hide (widget);
-               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "label_update_all"));
-               gtk_widget_hide (widget);
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "entry_search"));
                gtk_entry_set_text (GTK_ENTRY (widget), "");
+               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "search_bar"));
                gtk_widget_show (widget);
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "spinner_waiting"));
                gtk_spinner_stop (GTK_SPINNER (widget));
@@ -881,9 +875,7 @@ gs_main_set_overview_mode_ui (GsMainPrivate *priv, GsMainMode mode)
        case GS_MAIN_MODE_UPDATES:
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_update_all"));
                gtk_widget_show (widget);
-               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "label_update_all"));
-               gtk_widget_show (widget);
-               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "entry_search"));
+               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "search_bar"));
                gtk_widget_hide (widget);
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "spinner_waiting"));
                gtk_spinner_stop (GTK_SPINNER (widget));
@@ -891,10 +883,6 @@ gs_main_set_overview_mode_ui (GsMainPrivate *priv, GsMainMode mode)
        case GS_MAIN_MODE_WAITING:
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_update_all"));
                gtk_widget_hide (widget);
-               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "label_update_all"));
-               gtk_widget_hide (widget);
-               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "entry_search"));
-               gtk_widget_hide (widget);
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "spinner_waiting"));
                gtk_spinner_start (GTK_SPINNER (widget));
                break;


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