[gnome-software] Simplify the .ui file a bit



commit 9c74a16050b4dd0b2fc9490852b52fb7d4d07feb
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Sep 20 16:10:31 2013 -0400

    Simplify the .ui file a bit
    
    No need to explicitly construct labels as children of buttons.
    GtkButton does that for us, if we only set the label property.

 src/gnome-software.ui    |   30 ++++++------------------------
 src/gs-shell-installed.c |    8 ++++----
 2 files changed, 10 insertions(+), 28 deletions(-)
---
diff --git a/src/gnome-software.ui b/src/gnome-software.ui
index f127500..bee48f0 100644
--- a/src/gnome-software.ui
+++ b/src/gnome-software.ui
@@ -57,17 +57,11 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
+                        <property name="use_underline">True</property>
+                        <property name="label" translatable="yes" comments="Translators: A label for a 
button to show all available software.">_All</property>
                         <style>
                           <class name="toolbar-primary-buttons-software"/>
                         </style>
-                        <child>
-                          <object class="GtkLabel" id="label_button_all">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="use_underline">True</property>
-                            <property name="label" translatable="yes" comments="Translators: A label for a 
button to show all available software.">_All</property>
-                          </object>
-                        </child>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -80,17 +74,11 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
+                        <property name="use_underline">True</property>
+                        <property name="label" translatable="yes" comments="Translators: A label for a 
button to show only software which is already installed.">_Installed</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="use_underline">True</property>
-                            <property name="label" translatable="yes" comments="Translators: A label for a 
button to show only software which is already installed.">_Installed</property>
-                          </object>
-                        </child>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -103,17 +91,11 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
+                        <property name="use_underline">True</property>
+                        <property name="label" translatable="yes" comments="Translators: A label for a 
button to show only updates which are available to install.">_Updates</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="use_underline">True</property>
-                            <property name="label" translatable="yes" comments="Translators: A label for a 
button to show only updates which are available to install.">_Updates</property>
-                          </object>
-                        </child>
                       </object>
                       <packing>
                         <property name="expand">False</property>
diff --git a/src/gs-shell-installed.c b/src/gs-shell-installed.c
index 148f7d6..5ccda24 100644
--- a/src/gs-shell-installed.c
+++ b/src/gs-shell-installed.c
@@ -399,17 +399,17 @@ gs_shell_installed_pending_apps_changed_cb (GsPluginLoader *plugin_loader,
        GsApp *app;
 
        widget = GTK_WIDGET (gtk_builder_get_object (shell_installed->priv->builder,
-                                                    "label_button_installed"));
+                                                    "button_installed"));
        pending = gs_plugin_loader_get_pending (plugin_loader);
        if (pending->len == 0) {
                /* TRANSLATORS: this is tab button to show the list of
                 * installed software */
-               label = g_strdup (_("Installed"));
+               label = g_strdup (_("_Installed"));
        } else {
                /* TRANSLATORS: this is tab button to show the list of
                 * installed software. The '%d' refers to the number of
                 * applications either installing or erasing */
-               label = g_strdup_printf (_("Installed (%d)"), pending->len);
+               label = g_strdup_printf (_("_Installed (%d)"), pending->len);
        }
        for (i = 0; i < pending->len; i++) {
                app = GS_APP (g_ptr_array_index (pending, i));
@@ -422,7 +422,7 @@ gs_shell_installed_pending_apps_changed_cb (GsPluginLoader *plugin_loader,
                }
        }
 
-       gtk_label_set_label (GTK_LABEL (widget), label);
+       gtk_button_set_label (GTK_BUTTON (widget), label);
        g_free (label);
        g_ptr_array_unref (pending);
 }


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