[gnome-themes-standard] adwaita: properly theme GtkScale marks
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-themes-standard] adwaita: properly theme GtkScale marks
- Date: Tue, 15 Mar 2011 21:46:02 +0000 (UTC)
commit 100b6d7a3414842e381ed6ad742d6c4840abf34d
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Mar 15 17:45:30 2011 -0400
adwaita: properly theme GtkScale marks
src/adwaita_engine.c | 39 +++++++++++++++++++++++++++++++++++++++
themes/Adwaita/gtk-3.0/gtk.css | 4 ++++
2 files changed, 43 insertions(+), 0 deletions(-)
---
diff --git a/src/adwaita_engine.c b/src/adwaita_engine.c
index ba6ff08..7f68fc0 100644
--- a/src/adwaita_engine.c
+++ b/src/adwaita_engine.c
@@ -1628,6 +1628,44 @@ adwaita_engine_render_icon_pixbuf (GtkThemingEngine *engine,
}
static void
+adwaita_engine_render_line (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x0,
+ gdouble y0,
+ gdouble x1,
+ gdouble y1)
+{
+ const GtkWidgetPath *path;
+
+ path = gtk_theming_engine_get_path (engine);
+
+ if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_MARK) &&
+ gtk_widget_path_is_type (path, GTK_TYPE_SCALE)) {
+ GtkStateFlags state;
+ GdkRGBA bg;
+
+ state = gtk_theming_engine_get_state (engine);
+ gtk_theming_engine_get_background_color (engine, state, &bg);
+
+ cairo_save (cr);
+
+ cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
+ cairo_set_line_width (cr, 1);
+
+ cairo_move_to (cr, x0 + 0.5, y0 + 0.5);
+ cairo_line_to (cr, x1 + 0.5, y1 + 0.5);
+
+ gdk_cairo_set_source_rgba (cr, &bg);
+ cairo_stroke (cr);
+
+ cairo_restore (cr);
+ } else {
+ GTK_THEMING_ENGINE_CLASS (adwaita_engine_parent_class)->render_line (engine, cr,
+ x0, y0, x1, y1);
+ }
+}
+
+static void
adwaita_engine_class_init (AdwaitaEngineClass *klass)
{
GtkThemingEngineClass *engine_class = GTK_THEMING_ENGINE_CLASS (klass);
@@ -1644,6 +1682,7 @@ adwaita_engine_class_init (AdwaitaEngineClass *klass)
engine_class->render_slider = adwaita_engine_render_slider;
engine_class->render_handle = adwaita_engine_render_handle;
engine_class->render_icon_pixbuf = adwaita_engine_render_icon_pixbuf;
+ engine_class->render_line = adwaita_engine_render_line;
gtk_theming_engine_register_property (ADWAITA_NAMESPACE, NULL,
g_param_spec_boxed ("focus-border-color",
diff --git a/themes/Adwaita/gtk-3.0/gtk.css b/themes/Adwaita/gtk-3.0/gtk.css
index c0791c6..57638b4 100644
--- a/themes/Adwaita/gtk-3.0/gtk.css
+++ b/themes/Adwaita/gtk-3.0/gtk.css
@@ -328,6 +328,10 @@ GtkScale.progressbar {
border-style: solid;
}
+GtkScale.mark {
+ background-color: shade (@theme_bg_color, 0.56);
+}
+
GtkFrame,
GtkCalendar {
padding: 2;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]