[Xfce4-commits] <xfce4-panel:devel> Allow customizing the lucency of the minimized icons.

Nick Schermer noreply at xfce.org
Sat Nov 28 21:02:04 CET 2009


Updating branch refs/heads/devel
         to 0e68a038d765d86ef3c0949d2ef7cd6420b765dd (commit)
       from 30821f2df2b48e042274dd33a5ac217b2eb66251 (commit)

commit 0e68a038d765d86ef3c0949d2ef7cd6420b765dd
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Nov 28 18:24:55 2009 +0100

    Allow customizing the lucency of the minimized icons.

 docs/README.gtkrc-2.0              |    3 +++
 plugins/tasklist/tasklist-widget.c |   16 ++++++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/docs/README.gtkrc-2.0 b/docs/README.gtkrc-2.0
index ac1d482..be89722 100644
--- a/docs/README.gtkrc-2.0
+++ b/docs/README.gtkrc-2.0
@@ -17,6 +17,9 @@ style "xfce-tasklist-style"
   
   # Ellipsizing used in the task list button label.
   XfceTasklist::ellipsize-mode = PANGO_ELLIPSIZE_END
+  
+  # Lucency of minimized icons. Valid values are between 0 and 100.
+  XfceTasklist::minimized-icon-lucency = 50
 }
 class "XfceTasklist" style "xfce-tasklist-style"
 
diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index 41f044d..4543f64 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -41,6 +41,7 @@
 
 #define DEFAULT_BUTTON_SIZE      (25)
 #define DEFAULT_BUTTON_LENGTH    (200)
+#define DEFAULT_ICON_LUCENCY     (50)
 #define WIREFRAME_SIZE           (5)
 #define xfce_taskbar_lock()      G_BEGIN_DECLS { locked++; } G_END_DECLS;
 #define xfce_taskbar_unlock()    G_BEGIN_DECLS { if (locked > 0) locked--; else g_assert_not_reached (); } G_END_DECLS;
@@ -129,6 +130,7 @@ struct _XfceTasklist
   gint                  max_button_length;
   gint                  max_button_size;
   PangoEllipsizeMode    ellipsize_mode;
+  gint                  minimized_icon_lucency;
 };
 
 struct _XfceTasklistChild
@@ -311,6 +313,14 @@ xfce_tasklist_class_init (XfceTasklistClass *klass)
                                                               PANGO_TYPE_ELLIPSIZE_MODE,
                                                               PANGO_ELLIPSIZE_END,
                                                               EXO_PARAM_READABLE));
+
+  gtk_widget_class_install_style_property (gtkwidget_class,
+                                           g_param_spec_int ("minimized-icon-lucency",
+                                                             NULL,
+                                                             "Lucent percentage of minimized icons",
+                                                             0, 100,
+                                                             DEFAULT_ICON_LUCENCY,
+                                                             EXO_PARAM_READABLE));
 }
 
 
@@ -339,6 +349,7 @@ xfce_tasklist_init (XfceTasklist *tasklist)
 #endif
   tasklist->max_button_length = DEFAULT_BUTTON_LENGTH;
   tasklist->max_button_size = DEFAULT_BUTTON_SIZE;
+  tasklist->minimized_icon_lucency = DEFAULT_ICON_LUCENCY;
   tasklist->ellipsize_mode = PANGO_ELLIPSIZE_END;
   tasklist->grouping = XFCE_TASKLIST_GROUPING_DEFAULT;
   tasklist->sort_order = XFCE_TASKLIST_SORT_ORDER_DEFAULT;
@@ -685,6 +696,7 @@ xfce_tasklist_style_set (GtkWidget *widget,
                         "max-button-length", &max_button_length,
                         "ellipsize-mode", &tasklist->ellipsize_mode,
                         "max-button-size", &max_button_size,
+                        "minimized-icon-lucency", &tasklist->minimized_icon_lucency,
                         NULL);
 
   /* update the widget */
@@ -1248,11 +1260,11 @@ tasklist_button_icon_changed (WnckWindow        *window,
 
   /* create a spotlight version of the icon when minimized */
   if (child->tasklist->only_minimized == FALSE
+      && child->tasklist->minimized_icon_lucency < 100
       && wnck_window_is_minimized (window))
     {
       /* create lightened version */
-      lucent = exo_gdk_pixbuf_lucent (pixbuf, 50);
-
+      lucent = exo_gdk_pixbuf_lucent (pixbuf, child->tasklist->minimized_icon_lucency);
       if (G_LIKELY (lucent != NULL))
         {
           /* set the button icon */



More information about the Xfce4-commits mailing list