summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHorst3180 <horst3180@users.noreply.github.com>2015-03-04 16:33:57 +0100
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2015-04-05 22:32:47 +0300
commit9f092ba16057c280c907a58af14df5ab6fad3b80 (patch)
tree942993cf29a2a4bd354288d0458e25c15b8c50af
parent4b7696f9934ecd769e213371ad5f6080b1b6873c (diff)
downloadmetacity-9f092ba16057c280c907a58af14df5ab6fad3b80.tar.gz
theme: add style classes to the titlebuttons
https://bugzilla.gnome.org/show_bug.cgi?id=745108
-rw-r--r--src/ui/theme.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/ui/theme.c b/src/ui/theme.c
index ada31519..81c337d0 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);
}
}