[gnome-themes-standard] engine: remove the custom focus ring implementation
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-themes-standard] engine: remove the custom focus ring implementation
- Date: Thu, 1 May 2014 16:16:35 +0000 (UTC)
commit aefc721d0d718cd28cb4ee92b83af094d0f53ae0
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu May 1 18:05:16 2014 +0200
engine: remove the custom focus ring implementation
Now that GTK has it.
themes/Adwaita/gtk-3.0/Makefile.am | 5 +-
themes/Adwaita/gtk-3.0/adwaita_engine.c | 71 ------------------
themes/Adwaita/gtk-3.0/adwaita_utils.c | 119 -------------------------------
themes/Adwaita/gtk-3.0/adwaita_utils.h | 49 -------------
themes/Adwaita/gtk-3.0/gtk-widgets.css | 6 +-
5 files changed, 5 insertions(+), 245 deletions(-)
---
diff --git a/themes/Adwaita/gtk-3.0/Makefile.am b/themes/Adwaita/gtk-3.0/Makefile.am
index 7ec1f2c..4318280 100644
--- a/themes/Adwaita/gtk-3.0/Makefile.am
+++ b/themes/Adwaita/gtk-3.0/Makefile.am
@@ -2,10 +2,7 @@ enginedir = $(libdir)/gtk-3.0/$(GTK3_VERSION)/theming-engines
engine_LTLIBRARIES =
engine_LTLIBRARIES += libadwaita.la
-libadwaita_la_SOURCES = \
- adwaita_utils.h \
- adwaita_utils.c \
- adwaita_engine.c
+libadwaita_la_SOURCES = adwaita_engine.c
libadwaita_la_CFLAGS = $(GTK3_ENGINE_CFLAGS)
libadwaita_la_LDFLAGS = -module -avoid-version -no-undefined
libadwaita_la_LIBADD = $(GTK3_ENGINE_LIBS)
diff --git a/themes/Adwaita/gtk-3.0/adwaita_engine.c b/themes/Adwaita/gtk-3.0/adwaita_engine.c
index 74931f8..bc55eb3 100644
--- a/themes/Adwaita/gtk-3.0/adwaita_engine.c
+++ b/themes/Adwaita/gtk-3.0/adwaita_engine.c
@@ -32,8 +32,6 @@
#include <gdk/gdkx.h>
#endif
-#include "adwaita_utils.h"
-
#define ADWAITA_NAMESPACE "adwaita"
typedef struct _AdwaitaEngine AdwaitaEngine;
@@ -169,80 +167,11 @@ adwaita_engine_init (AdwaitaEngine *self)
}
static void
-adwaita_engine_render_focus (GtkThemingEngine *engine,
- cairo_t *cr,
- gdouble x,
- gdouble y,
- gdouble width,
- gdouble height)
-{
- GdkRGBA *border_color = NULL;
- GtkStateFlags state;
- gint line_width, focus_pad;
- gint border_radius;
- double dashes[2] = { 2.0, 0.2 };
- const GtkWidgetPath *path;
- GtkBorderStyle border_style;
-
- path = gtk_theming_engine_get_path (engine);
- state = gtk_theming_engine_get_state (engine);
- gtk_theming_engine_get (engine, state,
- "outline-color", &border_color,
- "outline-style", &border_style,
- "outline-offset", &border_radius,
- NULL);
-
- gtk_theming_engine_get_style (engine,
- "focus-line-width", &line_width,
- "focus-padding", &focus_pad,
- NULL);
-
- /* the treeview rows don't change allocation when modifying focus-padding,
- * so we have to move the focus ring inside the allocated area manually.
- */
- if (gtk_widget_path_is_type (path, GTK_TYPE_TREE_VIEW))
- {
- x += focus_pad;
- y += focus_pad;
- width -= 2 * focus_pad;
- height -= 2 * focus_pad;
- }
-
- cairo_save (cr);
- cairo_set_line_width (cr, line_width);
-
- if (line_width > 1)
- _cairo_round_rectangle_sides (cr, border_radius,
- x, y, width, height,
- SIDE_ALL, GTK_JUNCTION_NONE);
- else
- _cairo_round_rectangle_sides (cr, border_radius,
- x + 0.5, y + 0.5,
- width - 1, height - 1,
- SIDE_ALL, GTK_JUNCTION_NONE);
-
- if (border_style == GTK_BORDER_STYLE_DASHED)
- cairo_set_dash (cr, dashes, 1, 0.0);
-
- if (border_color != NULL)
- gdk_cairo_set_source_rgba (cr, border_color);
-
- cairo_stroke (cr);
- cairo_restore (cr);
-
- if (border_color != NULL)
- gdk_rgba_free (border_color);
-}
-
-static void
adwaita_engine_class_init (AdwaitaEngineClass *klass)
{
- GtkThemingEngineClass *engine_class = GTK_THEMING_ENGINE_CLASS (klass);
GObjectClass *oclass = G_OBJECT_CLASS (klass);
oclass->finalize = adwaita_engine_finalize;
-
- engine_class->render_focus = adwaita_engine_render_focus;
}
static void
diff --git a/themes/Adwaita/gtk-3.0/gtk-widgets.css b/themes/Adwaita/gtk-3.0/gtk-widgets.css
index 9880bfa..56a4117 100644
--- a/themes/Adwaita/gtk-3.0/gtk-widgets.css
+++ b/themes/Adwaita/gtk-3.0/gtk-widgets.css
@@ -45,7 +45,9 @@
*/
outline-color: alpha(@theme_text_color, 0.3);
outline-style: dashed;
- outline-offset: 2px;
+ outline-offset: -1px;
+ outline-width: 1px;
+ outline-radius: 2px;
}
/***************
@@ -3796,7 +3798,7 @@ GtkIconView.cell:selected:focus {
*/
outline-color: @treeview_focus_border;
outline-style: solid;
- outline-offset: 3px;
+ outline-radius: 3px;
}
.view {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]