[Xfce4-commits] <xfce4-taskbar-plugin:master> Added some logic to make the button 'press' visually.

Gearoid Murphy noreply at xfce.org
Wed Oct 10 21:42:01 CEST 2012


Updating branch refs/heads/master
         to 18be87d7c47f92ff99f9f4aa94e9b11269e4b3a6 (commit)
       from fce21021c37133d9ad26ab7f0bfa2d4a7f341bb3 (commit)

commit 18be87d7c47f92ff99f9f4aa94e9b11269e4b3a6
Author: Gearoid Murphy <gearoid at murphy.com>
Date:   Wed Oct 10 20:24:50 2012 +0100

    Added some logic to make the button 'press' visually.

 taskbar-widget.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/taskbar-widget.c b/taskbar-widget.c
index 1f69bf9..ca3d4c1 100644
--- a/taskbar-widget.c
+++ b/taskbar-widget.c
@@ -1061,7 +1061,6 @@ static void xfce_taskbar_window_added (WnckScreen *screen, WnckWindow *window, X
     gtk_widget_queue_resize (GTK_WIDGET (taskbar));
 }
 
-
 static void xfce_taskbar_window_removed (WnckScreen *screen, WnckWindow *window, XfceTaskBar *taskbar)
 {
     GList *li;
@@ -1118,8 +1117,6 @@ static void xfce_taskbar_window_removed (WnckScreen *screen, WnckWindow *window,
     
 }
 
-
-
 static void xfce_taskbar_viewports_changed (WnckScreen *screen, XfceTaskBar *taskbar)
 {
     WnckWorkspace *active_ws;
@@ -1134,8 +1131,6 @@ static void xfce_taskbar_viewports_changed (WnckScreen *screen, XfceTaskBar *tas
     xfce_taskbar_active_workspace_changed (screen, active_ws, taskbar);
 }
 
-
-
 static void xfce_taskbar_skipped_windows_state_changed (WnckWindow *window, WnckWindowState changed_state, WnckWindowState new_state, XfceTaskBar *taskbar)
 {
     panel_return_if_fail (XFCE_IS_taskbar (taskbar));
@@ -1154,7 +1149,6 @@ static void xfce_taskbar_skipped_windows_state_changed (WnckWindow *window, Wnck
     }
 }
 
-
 static gboolean xfce_taskbar_update_icon_geometries (gpointer data)
 {
     XfceTaskBar *taskbar = XFCE_taskbar (data);
@@ -1378,8 +1372,6 @@ static inline gboolean xfce_taskbar_button_visible (XfceTaskBarWNode *child, Wnc
     return FALSE;
 }
 
-
-
 static void xfce_taskbar_button_icon_changed (WnckWindow *window, XfceTaskBarWNode *child)
 {
     GdkPixbuf *pixbuf;
@@ -2235,6 +2227,14 @@ static void xfce_taskbar_group_button_menu_destroy(GtkWidget *menu, XfceTaskBarG
 #endif
 }
 
+
+static gboolean xfce_taskbar_group_button_press_event
+(GtkWidget *button, GdkEventButton *event, XfceTaskBarGroup *group)
+{
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (group->button), TRUE);
+    return TRUE ;
+}
+
 // This function handles all the logic for mouse button relase on the taskbar icons
 static gboolean xfce_taskbar_group_button_release_event
 (GtkWidget *button, GdkEventButton *event, XfceTaskBarGroup *group)
@@ -2242,6 +2242,7 @@ static gboolean xfce_taskbar_group_button_release_event
     GtkWidget *panel_plugin;
     GtkWidget *menu_widget;
 
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (group->button), FALSE);
     //Disable the timeout, if active
     DISABLE_HOVER_TIMEOUT(group);
     
@@ -2614,6 +2615,7 @@ static XfceTaskBarGroup * xfce_taskbar_group_button_new (const char *group_name,
     gtk_container_add( GTK_CONTAINER(group->align), group->icon);
     gtk_container_add (GTK_CONTAINER (group->button), group->align);
     
+    g_signal_connect (G_OBJECT (group->button), "button-press-event", G_CALLBACK (xfce_taskbar_group_button_press_event), group);
     g_signal_connect (G_OBJECT (group->button), "button-release-event", G_CALLBACK (xfce_taskbar_group_button_release_event), group);
     
     g_signal_connect(G_OBJECT(group->button), "enter-notify-event", G_CALLBACK(xfce_taskbar_group_button_enter_event), group);


More information about the Xfce4-commits mailing list