[gnome-applets/wip/segeiger/window-picker-in-process: 8/8] TaskItem: Simpliy if-structure



commit fd49600cfcd541d1c73cae81b4c116d31f83a9c9
Author: Sebastian Geiger <sbastig gmx net>
Date:   Sun Jul 12 01:03:18 2015 +0200

    TaskItem: Simpliy if-structure

 windowpicker/src/task-item.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/windowpicker/src/task-item.c b/windowpicker/src/task-item.c
index b96158a..d7a0a51 100644
--- a/windowpicker/src/task-item.c
+++ b/windowpicker/src/task-item.c
@@ -421,19 +421,20 @@ static gboolean task_item_draw (GtkWidget *widget,
             (area.y + (area.height - gdk_pixbuf_get_height (desat)) / 2));
         g_object_unref (desat);
     }
+    gdouble alpha;
     if (!priv->mouse_over && attention) { /* urgent */
         GTimeVal current_time;
         g_get_current_time (&current_time);
         gdouble ms = (
             current_time.tv_sec - priv->urgent_time.tv_sec) * 1000 +
             (current_time.tv_usec - priv->urgent_time.tv_usec) / 1000;
-        gdouble alpha = .66 + (cos (3.15 * ms / 600) / 3);
-        cairo_paint_with_alpha (cr, alpha);
+        alpha = .66 + (cos (3.15 * ms / 600) / 3);
     } else if (priv->mouse_over || active || !icons_greyscale) { /* focused */
-        cairo_paint (cr);
+        alpha = 1.0;
     } else { /* not focused */
-        cairo_paint_with_alpha (cr, .65);
+        alpha = .65;
     }
+    cairo_paint_with_alpha (cr, alpha);
     cairo_destroy (cr);
     return FALSE;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]