[Xfce4-commits] [apps/xfdashboard] 03/03: Add/remove pseudo-class ':insensitive' when actor changes its reactive state
noreply at xfce.org
noreply at xfce.org
Tue Jan 26 13:52:54 CET 2016
This is an automated email from the git hooks/post-receive script.
nomad pushed a commit to branch master
in repository apps/xfdashboard.
commit 99178d95346ae6bd2b721f23175ed2b58b78d697
Author: Stephan Haller <nomad at froevel.de>
Date: Tue Jan 26 13:52:31 2016 +0100
Add/remove pseudo-class ':insensitive' when actor changes its reactive state
---
xfdashboard/actor.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/xfdashboard/actor.c b/xfdashboard/actor.c
index 90cbb44..c288307 100644
--- a/xfdashboard/actor.c
+++ b/xfdashboard/actor.c
@@ -190,6 +190,33 @@ static void _xfdashboard_actor_on_name_changed(GObject *inObject,
_xfdashboard_actor_invalidate_recursive(CLUTTER_ACTOR(self));
}
+/* Actor's reactive state changed */
+static void _xfdashboard_actor_on_reactive_changed(GObject *inObject,
+ GParamSpec *inSpec,
+ gpointer inUserData)
+{
+ XfdashboardActor *self;
+
+ g_return_if_fail(XFDASHBOARD_IS_ACTOR(inObject));
+
+ self=XFDASHBOARD_ACTOR(inObject);
+
+ /* Set pseudo-class ':insensitive' if actor is now not reactive
+ * and remove this pseudo-class if actor is now reactive.
+ */
+ if(clutter_actor_get_reactive(CLUTTER_ACTOR(self)))
+ {
+ xfdashboard_stylable_add_pseudo_class(XFDASHBOARD_STYLABLE(self), "insensitive");
+ }
+ else
+ {
+ xfdashboard_stylable_remove_pseudo_class(XFDASHBOARD_STYLABLE(self), "insensitive");
+ }
+
+ /* Invalide styling to get it recomputed */
+ _xfdashboard_actor_invalidate_recursive(CLUTTER_ACTOR(self));
+}
+
/* Update effects of actor with string of list of effect IDs */
static void _xfdashboard_actor_update_effects(XfdashboardActor *self, const gchar *inEffects)
{
@@ -967,6 +994,7 @@ void xfdashboard_actor_init(XfdashboardActor *self)
/* Connect signals */
g_signal_connect(self, "notify::mapped", G_CALLBACK(_xfdashboard_actor_on_mapped_changed), NULL);
g_signal_connect(self, "notify::name", G_CALLBACK(_xfdashboard_actor_on_name_changed), NULL);
+ g_signal_connect(self, "notify::reactive", G_CALLBACK(_xfdashboard_actor_on_reactive_changed), NULL);
}
/* IMPLEMENTATION: GType */
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list