[Xfce4-commits] [xfce/xfce4-panel] 01/01: Resurrect the marching ants when panel prefs are open

noreply at xfce.org noreply at xfce.org
Fri Mar 3 00:24:31 CET 2017


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

ochosi pushed a commit to branch master
in repository xfce/xfce4-panel.

commit 879497894ad6d9fa72fd6dd6a899f463a5e4aecb
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Fri Mar 3 00:24:26 2017 +0100

    Resurrect the marching ants when panel prefs are open
    
    This is now all done in CSS as opposed to cairo.
---
 panel/panel-base-window.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/panel/panel-base-window.c b/panel/panel-base-window.c
index a473464..ad2ed89 100644
--- a/panel/panel-base-window.c
+++ b/panel/panel-base-window.c
@@ -565,9 +565,21 @@ panel_base_window_composited_changed (GtkWidget *widget)
 static gboolean
 panel_base_window_active_timeout (gpointer user_data)
 {
-  /* redraw to update marching ants */
-  gtk_widget_queue_draw (GTK_WIDGET (user_data));
+  PanelBaseWindow        *window = PANEL_BASE_WINDOW (user_data);
+  GTimeVal                timeval;
+  gboolean                solid = TRUE;
+  gchar                  *css_string;
+
+  /* Animate the border à la "marching ants" by changing styles from solid to dashed */
+  g_get_current_time (&timeval);
+  if (timeval.tv_sec%2 == 0)
+    solid = TRUE;
+  else
+    solid = FALSE;
 
+  css_string = g_strdup_printf (".xfce4-panel.background { border: 1px %s #ff0000; }",
+                                solid ? "solid" : "dashed");
+  panel_base_window_set_background_css (window, css_string);
   return TRUE;
 }
 
@@ -577,6 +589,10 @@ static void
 panel_base_window_active_timeout_destroyed (gpointer user_data)
 {
   PANEL_BASE_WINDOW (user_data)->priv->active_timeout_id = 0;
+  PanelBaseWindow        *window = PANEL_BASE_WINDOW (user_data);
+
+  /* Reset the css style provider to disable the marching ants */
+  panel_base_window_reset_background_css (window);
 }
 
 

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


More information about the Xfce4-commits mailing list