[Xfce4-commits] [apps/xfdashboard] 01/02: Keep application buttons for favourites always above dynamically added one for non-favourite applications running

noreply at xfce.org noreply at xfce.org
Wed Sep 2 21:22:25 CEST 2015


This is an automated email from the git hooks/post-receive script.

nomad pushed a commit to branch master
in repository apps/xfdashboard.

commit 6d6f7e09195990764fc70ced58e2d69a7ed72dca
Author: Stephan Haller <nomad at froevel.de>
Date:   Wed Sep 2 21:09:09 2015 +0200

    Keep application buttons for favourites always above dynamically added one for non-favourite applications running
---
 xfdashboard/quicklaunch.c |   24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/xfdashboard/quicklaunch.c b/xfdashboard/quicklaunch.c
index 213f4bc..1cc2ecb 100644
--- a/xfdashboard/quicklaunch.c
+++ b/xfdashboard/quicklaunch.c
@@ -86,6 +86,8 @@ struct _XfdashboardQuicklaunchPrivate
 
 	ClutterActor					*selectedItem;
 
+	ClutterActor					*separatorFavouritesToDynamic;
+
 	XfdashboardApplicationDatabase	*appDB;
 	XfdashboardApplicationTracker	*appTracker;
 };
@@ -965,7 +967,7 @@ static void _xfdashboard_quicklaunch_update_icons_from_property(XfdashboardQuick
 		xfdashboard_button_set_style(XFDASHBOARD_BUTTON(actor), XFDASHBOARD_BUTTON_STYLE_ICON);
 		xfdashboard_stylable_add_class(XFDASHBOARD_STYLABLE(actor), "is-favourite-app");
 		clutter_actor_show(actor);
-		clutter_actor_add_child(CLUTTER_ACTOR(self), actor);
+		clutter_actor_insert_child_below(CLUTTER_ACTOR(self), actor, priv->separatorFavouritesToDynamic);
 		g_signal_connect_swapped(actor, "clicked", G_CALLBACK(_xfdashboard_quicklaunch_on_favourite_clicked), self);
 
 		/* Set up drag'n'drop */
@@ -1385,6 +1387,7 @@ static gboolean _xfdashboard_quicklaunch_selection_add_favourite(XfdashboardQuic
 																	const gchar *inAction,
 																	ClutterEvent *inEvent)
 {
+	XfdashboardQuicklaunchPrivate	*priv;
 	ClutterActor					*currentSelection;
 	GAppInfo						*appInfo;
 
@@ -1392,6 +1395,8 @@ static gboolean _xfdashboard_quicklaunch_selection_add_favourite(XfdashboardQuic
 	g_return_val_if_fail(XFDASHBOARD_IS_FOCUSABLE(inSource), CLUTTER_EVENT_PROPAGATE);
 	g_return_val_if_fail(inEvent, CLUTTER_EVENT_PROPAGATE);
 
+	priv=self->priv;
+
 	/* Get current selection of focusable actor and check if it is an actor
 	 * derived from XfdashboardApplicationButton.
 	 */
@@ -1436,7 +1441,7 @@ static gboolean _xfdashboard_quicklaunch_selection_add_favourite(XfdashboardQuic
 		favouriteActor=xfdashboard_application_button_new_from_app_info(appInfo);
 		clutter_actor_hide(favouriteActor);
 		xfdashboard_stylable_add_class(XFDASHBOARD_STYLABLE(favouriteActor), "is-favourite-app");
-		clutter_actor_add_child(CLUTTER_ACTOR(self), favouriteActor);
+		clutter_actor_insert_child_below(CLUTTER_ACTOR(self), favouriteActor, priv->separatorFavouritesToDynamic);
 
 		/* Update favourites from icon order */
 		_xfdashboard_quicklaunch_update_property_from_icons(self);
@@ -2310,6 +2315,12 @@ static void _xfdashboard_quicklaunch_dispose(GObject *inObject)
 		priv->favourites=NULL;
 	}
 
+	if(priv->separatorFavouritesToDynamic)
+	{
+		clutter_actor_destroy(priv->separatorFavouritesToDynamic);
+		priv->separatorFavouritesToDynamic=NULL;
+	}
+
 	/* Call parent's class dispose method */
 	G_OBJECT_CLASS(xfdashboard_quicklaunch_parent_class)->dispose(inObject);
 }
@@ -2619,6 +2630,15 @@ static void xfdashboard_quicklaunch_init(XfdashboardQuicklaunch *self)
 	g_signal_connect_swapped(dropAction, "drag-enter", G_CALLBACK(_xfdashboard_quicklaunch_on_trash_drop_enter), self);
 	g_signal_connect_swapped(dropAction, "drag-leave", G_CALLBACK(_xfdashboard_quicklaunch_on_trash_drop_leave), self);
 
+	/* Add a hidden actor used as separator between application buttons for
+	 * favourites and dynamically added one (for running non-favourite applications).
+	 * It used to add application buttons for favourites before dynamically
+	 * added ones.
+	 */
+	priv->separatorFavouritesToDynamic=clutter_actor_new();
+	clutter_actor_hide(priv->separatorFavouritesToDynamic);
+	clutter_actor_add_child(CLUTTER_ACTOR(self), priv->separatorFavouritesToDynamic);
+
 	/* Bind to xfconf to react on changes */
 	priv->xfconfFavouritesBindingID=xfconf_g_property_bind(priv->xfconfChannel,
 															FAVOURITES_XFCONF_PROP,

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list