[gnome-themes-standard] notebook: tweak the focus padding for the notebook tab shape



commit 04c5834dce100baca6c7d7613eb48b84e0ab4616
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Mar 14 11:39:22 2011 -0400

    notebook: tweak the focus padding for the notebook tab shape

 src/adwaita_engine.c           |   12 +++++++++++-
 themes/Adwaita/gtk-3.0/gtk.css |    4 +++-
 2 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/src/adwaita_engine.c b/src/adwaita_engine.c
index eadb8f7..3a3c2aa 100644
--- a/src/adwaita_engine.c
+++ b/src/adwaita_engine.c
@@ -166,7 +166,7 @@ adwaita_engine_render_focus (GtkThemingEngine *engine,
 	GdkRGBA *fill_color, *border_color = NULL;
 	cairo_pattern_t *pattern = NULL;
 	GtkStateFlags state;
-	gint line_width;
+	gint line_width, focus_pad;
 	gint border_radius;
 	gboolean use_dashes;
 	double dashes[2] = { 2.0, 0.2 };
@@ -182,8 +182,18 @@ adwaita_engine_render_focus (GtkThemingEngine *engine,
 
 	gtk_theming_engine_get_style (engine,
 				      "focus-line-width", &line_width,
+				      "focus-padding", &focus_pad,
 				      NULL);
 
+	if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_NOTEBOOK) &&
+	    gtk_theming_engine_has_region (engine, GTK_STYLE_REGION_TAB, NULL)) {
+		/* as we render the tab smaller than the whole allocation, we need
+		 * to recenter and resize the focus on the tab.
+		 */
+		y += 3.0;
+		height -= 3.0;
+	}
+
 	cairo_save (cr);
 	cairo_set_line_width (cr, line_width);
 
diff --git a/themes/Adwaita/gtk-3.0/gtk.css b/themes/Adwaita/gtk-3.0/gtk.css
index 62b98c1..1c13cb0 100644
--- a/themes/Adwaita/gtk-3.0/gtk.css
+++ b/themes/Adwaita/gtk-3.0/gtk.css
@@ -92,7 +92,6 @@
     -GtkButton-image-spacing: 4;
     -GtkButton-interior-focus: true;
     -GtkToolButton-icon-spacing: 4;
-    -GtkWidget-focus-padding: 2;
 
     -GtkTextView-error-underline-color: @error_color;
 
@@ -135,6 +134,7 @@
     color: @theme_fg_color;
     border-radius: 3;
 
+    -GtkWidget-focus-padding: 2;
     -GtkWidget-focus-line-width: 1;
     -adwaita-focus-border-color: alpha (@theme_text_color, 0.4);
     -adwaita-focus-border-radius: 2;
@@ -362,6 +362,8 @@ GtkCalendar {
                                      left top, left bottom,
                                      from (@theme_base_color),
                                      to (@switch_slider_color));
+
+    -adwaita-focus-border-radius: 2;
 }
 
 .notebook tab:active {



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