[gtk-theme-engine-clearlooks] Render thinner trough in GtkScale widgets.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-theme-engine-clearlooks] Render thinner trough in GtkScale widgets.
- Date: Wed, 19 Jan 2011 03:48:10 +0000 (UTC)
commit 68a69e8ba645e915bb12e7c6fe1592e2c4d89a23
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Jan 19 04:29:11 2011 +0100
Render thinner trough in GtkScale widgets.
src/adwaita_engine.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
---
diff --git a/src/adwaita_engine.c b/src/adwaita_engine.c
index 1323457..a55f276 100644
--- a/src/adwaita_engine.c
+++ b/src/adwaita_engine.c
@@ -429,6 +429,22 @@ adwaita_engine_render_frame (GtkThemingEngine *engine,
}
else
{
+ if (gtk_widget_path_is_type (path, GTK_TYPE_SCALE) &&
+ gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_TROUGH))
+ {
+ /* Render GtkScale trough thinner */
+ if (!gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_VERTICAL))
+ {
+ y += height / 2 - 3;
+ height = 6;
+ }
+ else
+ {
+ x += width / 2 - 3;
+ width = 6;
+ }
+ }
+
GTK_THEMING_ENGINE_CLASS (adwaita_engine_parent_class)->render_frame (engine, cr, x, y,
width, height);
}
@@ -437,6 +453,38 @@ adwaita_engine_render_frame (GtkThemingEngine *engine,
}
static void
+adwaita_engine_render_background (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ const GtkWidgetPath *path;
+
+ path = gtk_theming_engine_get_path (engine);
+
+ if (gtk_widget_path_is_type (path, GTK_TYPE_SCALE) &&
+ gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_TROUGH))
+ {
+ /* Render GtkScale trough thinner */
+ if (!gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_VERTICAL))
+ {
+ y += height / 2 - 3;
+ height = 6;
+ }
+ else
+ {
+ x += width / 2 - 3;
+ width = 6;
+ }
+ }
+
+ GTK_THEMING_ENGINE_CLASS (adwaita_engine_parent_class)->render_background (engine, cr, x, y,
+ width, height);
+}
+
+static void
adwaita_engine_render_expander (GtkThemingEngine *engine,
cairo_t *cr,
gdouble x,
@@ -612,6 +660,7 @@ adwaita_engine_class_init (AdwaitaEngineClass *klass)
engine_class->render_option = adwaita_engine_render_option;
engine_class->render_extension = adwaita_engine_render_extension;
engine_class->render_frame = adwaita_engine_render_frame;
+ engine_class->render_background = adwaita_engine_render_background;
engine_class->render_expander = adwaita_engine_render_expander;
engine_class->render_activity = adwaita_engine_render_activity;
engine_class->render_slider = adwaita_engine_render_slider;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]