Commit 9c74a160 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

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.
parent dc0282fc
......@@ -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>
......
......@@ -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);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment