[gnome-software] feature tile: Use GtkStack for switching between states
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] feature tile: Use GtkStack for switching between states
- Date: Tue, 2 Sep 2014 19:06:36 +0000 (UTC)
commit 77f59b6c9440aa1dda4c1bed7798ec13b1600ec3
Author: Kalev Lember <kalevlember gmail com>
Date: Tue Sep 2 20:44:31 2014 +0200
feature tile: Use GtkStack for switching between states
src/feature-tile.ui | 13 +++++++++----
src/gs-feature-tile.c | 6 +++---
2 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/src/feature-tile.ui b/src/feature-tile.ui
index c59f9a4..6ca72db 100644
--- a/src/feature-tile.ui
+++ b/src/feature-tile.ui
@@ -8,11 +8,10 @@
<class name="featured-tile"/>
</style>
<child>
- <object class="GtkOverlay" id="overlay">
+ <object class="GtkStack" id="stack">
<property name="visible">True</property>
- <property name="halign">fill</property>
- <property name="valign">fill</property>
- <child type="overlay">
+ <property name="can_focus">False</property>
+ <child>
<object class="GtkImage" id="waiting">
<property name="visible">True</property>
<property name="halign">center</property>
@@ -23,6 +22,9 @@
<class name="dim-label"/>
</style>
</object>
+ <packing>
+ <property name="name">waiting</property>
+ </packing>
</child>
<child>
<object class="GsBox" id="box">
@@ -78,6 +80,9 @@
</packing>
</child>
</object>
+ <packing>
+ <property name="name">content</property>
+ </packing>
</child>
</object>
</child>
diff --git a/src/gs-feature-tile.c b/src/gs-feature-tile.c
index 0930f34..b8a1c43 100644
--- a/src/gs-feature-tile.c
+++ b/src/gs-feature-tile.c
@@ -30,9 +30,9 @@ struct _GsFeatureTilePrivate
{
GsApp *app;
GtkWidget *image;
+ GtkWidget *stack;
GtkWidget *title;
GtkWidget *subtitle;
- GtkWidget *waiting;
GtkCssProvider *provider;
};
@@ -105,7 +105,7 @@ gs_feature_tile_set_app (GsFeatureTile *tile, GsApp *app)
priv->app = g_object_ref (app);
- gtk_widget_hide (priv->waiting);
+ gtk_stack_set_visible_child_name (GTK_STACK (priv->stack), "content");
g_signal_connect (priv->app, "notify::state",
G_CALLBACK (app_state_changed), tile);
@@ -197,9 +197,9 @@ gs_feature_tile_class_init (GsFeatureTileClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/feature-tile.ui");
gtk_widget_class_bind_template_child_private (widget_class, GsFeatureTile, image);
+ gtk_widget_class_bind_template_child_private (widget_class, GsFeatureTile, stack);
gtk_widget_class_bind_template_child_private (widget_class, GsFeatureTile, title);
gtk_widget_class_bind_template_child_private (widget_class, GsFeatureTile, subtitle);
- gtk_widget_class_bind_template_child_private (widget_class, GsFeatureTile, waiting);
}
GtkWidget *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]