[gnome-software] details: Move the spinner and the pending label to the content area
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] details: Move the spinner and the pending label to the content area
- Date: Mon, 11 Aug 2014 16:34:07 +0000 (UTC)
commit 1dc5326bef864f065641ec89af6c5b46e2905981
Author: Kalev Lember <kalevlember gmail com>
Date: Mon Aug 11 17:43:01 2014 +0200
details: Move the spinner and the pending label to the content area
... following the Install / Remove button move.
src/gnome-software.ui | 16 --------
src/gs-shell-details.c | 23 ++++++-----
src/gs-shell-details.ui | 95 +++++++++++++++++++++++++++++++---------------
src/gs-shell.c | 5 --
4 files changed, 76 insertions(+), 63 deletions(-)
---
diff --git a/src/gnome-software.ui b/src/gnome-software.ui
index 09286ed..afd9d3a 100644
--- a/src/gnome-software.ui
+++ b/src/gnome-software.ui
@@ -252,22 +252,6 @@
</object>
</child>
<child>
- <object class="GtkSpinner" id="header_spinner_end">
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="pack_type">end</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="header_label">
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="pack_type">end</property>
- </packing>
- </child>
- <child>
<object class="GtkButton" id="button_update_all">
<property name="use_underline">True</property>
<property name="label" translatable="yes">Restart & _Install</property>
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index ec07807..5f9f3b5 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -84,9 +84,11 @@ struct GsShellDetailsPrivate
GtkWidget *label_details_size_value;
GtkWidget *label_details_updated_value;
GtkWidget *label_details_version_value;
+ GtkWidget *label_pending;
GtkWidget *list_box_addons;
GtkWidget *scrolledwindow_details;
GtkWidget *spinner_details;
+ GtkWidget *spinner_install_remove;
GtkWidget *stack_details;
};
@@ -159,14 +161,12 @@ gs_shell_details_refresh (GsShellDetails *shell_details)
state = gs_app_get_state (priv->app);
/* label */
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "header_label"));
switch (state) {
case AS_APP_STATE_QUEUED_FOR_INSTALL:
- gtk_widget_set_visible (widget, TRUE);
- gtk_label_set_label (GTK_LABEL (widget), _("Pending"));
+ gtk_widget_set_visible (priv->label_pending, TRUE);
break;
default:
- gtk_widget_set_visible (widget, FALSE);
+ gtk_widget_set_visible (priv->label_pending, FALSE);
break;
}
@@ -246,10 +246,9 @@ gs_shell_details_refresh (GsShellDetails *shell_details)
}
/* spinner */
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "header_spinner_end"));
if (kind == GS_APP_KIND_SYSTEM) {
- gtk_widget_set_visible (widget, FALSE);
- gtk_spinner_stop (GTK_SPINNER (widget));
+ gtk_widget_set_visible (priv->spinner_install_remove, FALSE);
+ gtk_spinner_stop (GTK_SPINNER (priv->spinner_install_remove));
} else {
switch (state) {
case AS_APP_STATE_UNKNOWN:
@@ -259,13 +258,13 @@ gs_shell_details_refresh (GsShellDetails *shell_details)
case AS_APP_STATE_UPDATABLE:
case AS_APP_STATE_UNAVAILABLE:
case AS_APP_STATE_AVAILABLE_LOCAL:
- gtk_widget_set_visible (widget, FALSE);
- gtk_spinner_stop (GTK_SPINNER (widget));
+ gtk_widget_set_visible (priv->spinner_install_remove, FALSE);
+ gtk_spinner_stop (GTK_SPINNER (priv->spinner_install_remove));
break;
case AS_APP_STATE_INSTALLING:
case AS_APP_STATE_REMOVING:
- gtk_spinner_start (GTK_SPINNER (widget));
- gtk_widget_set_visible (widget, TRUE);
+ gtk_spinner_start (GTK_SPINNER (priv->spinner_install_remove));
+ gtk_widget_set_visible (priv->spinner_install_remove, TRUE);
break;
default:
g_warning ("App unexpectedly in state %s",
@@ -1409,9 +1408,11 @@ gs_shell_details_class_init (GsShellDetailsClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GsShellDetails, label_details_size_value);
gtk_widget_class_bind_template_child_private (widget_class, GsShellDetails,
label_details_updated_value);
gtk_widget_class_bind_template_child_private (widget_class, GsShellDetails,
label_details_version_value);
+ gtk_widget_class_bind_template_child_private (widget_class, GsShellDetails, label_pending);
gtk_widget_class_bind_template_child_private (widget_class, GsShellDetails, list_box_addons);
gtk_widget_class_bind_template_child_private (widget_class, GsShellDetails, scrolledwindow_details);
gtk_widget_class_bind_template_child_private (widget_class, GsShellDetails, spinner_details);
+ gtk_widget_class_bind_template_child_private (widget_class, GsShellDetails, spinner_install_remove);
gtk_widget_class_bind_template_child_private (widget_class, GsShellDetails, stack_details);
}
diff --git a/src/gs-shell-details.ui b/src/gs-shell-details.ui
index cd2a5fe..786185c 100644
--- a/src/gs-shell-details.ui
+++ b/src/gs-shell-details.ui
@@ -134,43 +134,76 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="button_install">
- <property name="use_underline">True</property>
- <property name="label" translatable="yes">_Install</property>
- <property name="width_request">105</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="halign">start</property>
- <property name="valign">start</property>
- <style>
- <class name="suggested-action"/>
- </style>
+ <object class="GtkBox" id="box_install_remove">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkButton" id="button_install">
+ <property name="use_underline">True</property>
+ <property name="label" translatable="yes">_Install</property>
+ <property name="width_request">105</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <style>
+ <class name="suggested-action"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button_remove">
+ <property name="use_underline">True</property>
+ <property name="label" translatable="yes">_Remove</property>
+ <property name="width_request">105</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <style>
+ <class name="destructive-action"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinner" id="spinner_install_remove">
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_pending">
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Pending</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
- <child>
- <object class="GtkButton" id="button_remove">
- <property name="use_underline">True</property>
- <property name="label" translatable="yes">_Remove</property>
- <property name="width_request">105</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="halign">start</property>
- <property name="valign">start</property>
- <style>
- <class name="destructive-action"/>
- </style>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
</object>
<packing>
<property name="expand">False</property>
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 6414ef5..c6daab0 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -136,11 +136,6 @@ gs_shell_change_mode (GsShell *shell,
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "header_spinner_start"));
gtk_spinner_stop (GTK_SPINNER (widget));
gtk_widget_hide (widget);
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "header_spinner_end"));
- gtk_spinner_stop (GTK_SPINNER (widget));
- gtk_widget_hide (widget);
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "header_label"));
- gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_select"));
gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_refresh"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]