[libhandy/wip/exalm/leaflet-transltions: 30/31] deck: Add 'progress' child property
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy/wip/exalm/leaflet-transltions: 30/31] deck: Add 'progress' child property
- Date: Tue, 4 Aug 2020 10:17:17 +0000 (UTC)
commit c8a6011f9157f864a94d9a1dca320508c0b5b194
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Fri Jul 31 22:56:42 2020 +0500
deck: Add 'progress' child property
Signed-off-by: Alexander Mikhaylenko <alexm gnome org>
src/hdy-deck.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
---
diff --git a/src/hdy-deck.c b/src/hdy-deck.c
index a778ecd6..22c189a7 100644
--- a/src/hdy-deck.c
+++ b/src/hdy-deck.c
@@ -76,6 +76,7 @@ enum {
CHILD_PROP_0,
CHILD_PROP_NAME,
CHILD_PROP_VISIBLE,
+ CHILD_PROP_PROGRESS,
LAST_CHILD_PROP,
};
@@ -750,6 +751,10 @@ hdy_deck_get_child_property (GtkContainer *container,
g_value_set_boolean (value, hdy_stackable_box_get_child_visible (HDY_GET_HELPER (container), widget));
break;
+ case CHILD_PROP_PROGRESS:
+ g_value_set_double (value, hdy_stackable_box_get_child_progress (HDY_GET_HELPER (container), widget));
+ break;
+
default:
GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec);
break;
@@ -1050,6 +1055,21 @@ hdy_deck_class_init (HdyDeckClass *klass)
FALSE,
G_PARAM_READABLE | G_PARAM_EXPLICIT_NOTIFY);
+ /**
+ * HdyDeck:progress:
+ *
+ * The child transition animation progress value. 0 means invisible, 1 means
+ * fully visible.
+ *
+ * Since: 1.0
+ */
+ child_props[CHILD_PROP_PROGRESS] =
+ g_param_spec_double ("progress",
+ _("Progress"),
+ _("The child transition animation progress value"),
+ 0.0, 1.0, 1.0,
+ G_PARAM_READABLE | G_PARAM_EXPLICIT_NOTIFY);
+
gtk_container_class_install_child_properties (container_class, LAST_CHILD_PROP, child_props);
gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_PANEL);
@@ -1094,6 +1114,15 @@ child_notify_visible_cb (HdyDeck *self,
child_props[CHILD_PROP_VISIBLE]);
}
+static void
+child_notify_progress_cb (HdyDeck *self,
+ GtkWidget *child)
+{
+ gtk_container_child_notify_by_pspec (GTK_CONTAINER (self),
+ child,
+ child_props[CHILD_PROP_PROGRESS]);
+}
+
static void
hdy_deck_init (HdyDeck *self)
{
@@ -1115,6 +1144,7 @@ hdy_deck_init (HdyDeck *self)
g_signal_connect_object (priv->box, "notify::can-swipe-forward", G_CALLBACK (notify_can_swipe_forward_cb),
self, G_CONNECT_SWAPPED);
g_signal_connect_object (priv->box, "notify::orientation", G_CALLBACK (notify_orientation_cb), self,
G_CONNECT_SWAPPED);
g_signal_connect_object (priv->box, "child-notify-visible", G_CALLBACK (child_notify_visible_cb), self,
G_CONNECT_SWAPPED);
+ g_signal_connect_object (priv->box, "child-notify-progress", G_CALLBACK (child_notify_progress_cb), self,
G_CONNECT_SWAPPED);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]