[metacity] theme: add style classes to the titlebuttons



commit 9f092ba16057c280c907a58af14df5ab6fad3b80
Author: Horst3180 <horst3180 users noreply github com>
Date:   Wed Mar 4 16:33:57 2015 +0100

    theme: add style classes to the titlebuttons
    
    https://bugzilla.gnome.org/show_bug.cgi?id=745108

 src/ui/theme.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/src/ui/theme.c b/src/ui/theme.c
index ada3151..81c337d 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -4999,6 +4999,22 @@ meta_frame_style_draw_with_style (MetaFrameStyle          *style,
     }
 }
 
+static const char *
+get_class_from_button_type (MetaButtonType type)
+{
+  switch (type)
+    {
+    case META_BUTTON_TYPE_CLOSE:
+      return "close";
+    case META_BUTTON_TYPE_MAXIMIZE:
+      return "maximize";
+    case META_BUTTON_TYPE_MINIMIZE:
+      return "minimize";
+    default:
+      return NULL;
+    }
+}
+
 /* Used for GTK+ theme */
 static void
 meta_frame_style_draw_with_style_gtk (MetaFrameStyle          *frame_style,
@@ -5079,6 +5095,12 @@ meta_frame_style_draw_with_style_gtk (MetaFrameStyle          *frame_style,
   for (button_type = META_BUTTON_TYPE_CLOSE; button_type < META_BUTTON_TYPE_LAST; button_type++)
     {
       MetaButtonState button_state;
+      const char *button_class;
+
+      button_class = get_class_from_button_type (button_type);
+
+      if (button_class)
+        gtk_style_context_add_class (style, button_class);
 
       get_button_rect (button_type, fgeom, 0, &button_rect);
 
@@ -5163,6 +5185,9 @@ meta_frame_style_draw_with_style_gtk (MetaFrameStyle          *frame_style,
         }
 
       cairo_restore (cr);
+
+      if (button_class)
+        gtk_style_context_remove_class (style, button_class);
     }
 }
 


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