[gnome-themes-standard] adwaita: add a way to theme menu arrows
- From: Cosimo Cecchi <cosimoc src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gnome-themes-standard] adwaita: add a way to theme menu arrows
 
- Date: Wed, 16 Mar 2011 18:46:54 +0000 (UTC)
 
commit 9a6cd3c3c475d6b7eb4e8add230e59f7a8c2914f
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Mar 16 14:06:21 2011 -0400
    adwaita: add a way to theme menu arrows
    
    With an engine property, there seems no way to do that from GTK+ proper.
 src/adwaita_engine.c           |   21 +++++++++++++++++++++
 themes/Adwaita/gtk-3.0/gtk.css |    4 ++++
 2 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/src/adwaita_engine.c b/src/adwaita_engine.c
index 7f68fc0..fb46f68 100644
--- a/src/adwaita_engine.c
+++ b/src/adwaita_engine.c
@@ -149,6 +149,22 @@ adwaita_engine_render_arrow (GtkThemingEngine *engine,
 
         state = gtk_theming_engine_get_state (engine);
 	gtk_theming_engine_get_color (engine, state, &color);
+
+	if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_MENUITEM) &&
+	    !(state & GTK_STATE_FLAG_INSENSITIVE) && !(state & GTK_STATE_FLAG_PRELIGHT)) {
+		GdkRGBA *arrow_color;
+
+		gtk_theming_engine_get (engine, state,
+					"-adwaita-menuitem-arrow-color", &arrow_color,
+					NULL);
+
+		if (arrow_color != NULL) {
+			color = *arrow_color;
+		}
+
+		gdk_rgba_free (arrow_color);
+	}
+
 	gdk_cairo_set_source_rgba (cr, &color);
 	cairo_stroke (cr);
         
@@ -1720,6 +1736,11 @@ adwaita_engine_class_init (AdwaitaEngineClass *klass)
 								    "Focus border uses dashes",
 								    "Focus border uses dashes",
 								    FALSE, 0));
+	gtk_theming_engine_register_property (ADWAITA_NAMESPACE, NULL,
+					      g_param_spec_boxed ("menuitem-arrow-color",
+								  "Menuitem arrow color",
+								  "Menuitem arrow color",
+								  GDK_TYPE_RGBA, 0));
 }
 
 static void
diff --git a/themes/Adwaita/gtk-3.0/gtk.css b/themes/Adwaita/gtk-3.0/gtk.css
index 5e20427..c5e39bd 100644
--- a/themes/Adwaita/gtk-3.0/gtk.css
+++ b/themes/Adwaita/gtk-3.0/gtk.css
@@ -587,6 +587,10 @@ GtkComboBox.button {
 
 }
 
+.menuitem {
+    -adwaita-menuitem-arrow-color: @menu_controls_color;
+}
+
 .menuitem:active,
 .menuitem:prelight {
     background-color: @selected_bg_color;
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]