[gnome-themes-standard] adwaita: add a focus-dashes style property
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-themes-standard] adwaita: add a focus-dashes style property
- Date: Mon, 14 Mar 2011 20:12:40 +0000 (UTC)
commit 05c18fcfa08361e18d78244fbba64cdc30b39fdb
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Mar 14 11:33:20 2011 -0400
adwaita: add a focus-dashes style property
focus-dashes enables a dashed line for focus.
src/adwaita_engine.c | 12 ++++++++++++
themes/Adwaita/gtk-3.0/gtk.css | 6 +++++-
2 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/src/adwaita_engine.c b/src/adwaita_engine.c
index c6048e8..eadb8f7 100644
--- a/src/adwaita_engine.c
+++ b/src/adwaita_engine.c
@@ -168,6 +168,8 @@ adwaita_engine_render_focus (GtkThemingEngine *engine,
GtkStateFlags state;
gint line_width;
gint border_radius;
+ gboolean use_dashes;
+ double dashes[2] = { 2.0, 0.2 };
state = gtk_theming_engine_get_state (engine);
gtk_theming_engine_get (engine, state,
@@ -175,6 +177,7 @@ adwaita_engine_render_focus (GtkThemingEngine *engine,
"-adwaita-focus-fill-color", &fill_color,
"-adwaita-focus-border-radius", &border_radius,
"-adwaita-focus-border-gradient", &pattern,
+ "-adwaita-focus-border-dashes", &use_dashes,
NULL);
gtk_theming_engine_get_style (engine,
@@ -198,6 +201,10 @@ adwaita_engine_render_focus (GtkThemingEngine *engine,
cairo_fill_preserve (cr);
}
+ if (use_dashes) {
+ cairo_set_dash (cr, dashes, 1, 0.0);
+ }
+
/* if we have a gradient, draw the gradient, otherwise
* draw the line if we have a color for it.
*/
@@ -1678,6 +1685,11 @@ adwaita_engine_class_init (AdwaitaEngineClass *klass)
"Border gradient",
"Border gradient",
CAIRO_GOBJECT_TYPE_PATTERN, 0));
+ gtk_theming_engine_register_property (ADWAITA_NAMESPACE, NULL,
+ g_param_spec_boolean ("focus-border-dashes",
+ "Focus border uses dashes",
+ "Focus border uses dashes",
+ FALSE, 0));
}
static void
diff --git a/themes/Adwaita/gtk-3.0/gtk.css b/themes/Adwaita/gtk-3.0/gtk.css
index 5c713a3..62b98c1 100644
--- a/themes/Adwaita/gtk-3.0/gtk.css
+++ b/themes/Adwaita/gtk-3.0/gtk.css
@@ -136,10 +136,11 @@
border-radius: 3;
-GtkWidget-focus-line-width: 1;
- -adwaita-focus-border-color: @keyboard_focus_border_a;
+ -adwaita-focus-border-color: alpha (@theme_text_color, 0.4);
-adwaita-focus-border-radius: 2;
-adwaita-focus-fill-color: none;
-adwaita-focus-border-gradient: none;
+ -adwaita-focus-border-dashes: 1;
}
/***************
@@ -477,6 +478,7 @@ GtkComboBox.button {
from (alpha (@keyboard_focus_border_a, 0.62)),
to (alpha (@keyboard_focus_border_b, 0.62)));
-adwaita-focus-border-radius: 1;
+ -adwaita-focus-border-dashes: 0;
-GtkWidget-focus-line-width: 2;
border-radius: 2;
@@ -928,6 +930,7 @@ GtkIconView.view.cell:selected:focused {
*/
-adwaita-focus-border-color: @progressbar_border;
-adwaita-focus-border-radius: 3;
+ -adwaita-focus-border-dashes: 0;
}
.view {
@@ -943,6 +946,7 @@ GtkTreeView {
-GtkWidget-focus-line-width: 1;
-adwaita-focus-border-radius: 0;
+ -adwaita-focus-border-dashes: 0;
}
column-header {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]