[gtk+] GtkThemingEngine: Fix handles rendering
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkThemingEngine: Fix handles rendering
- Date: Mon, 10 Jan 2011 23:07:04 +0000 (UTC)
commit 4c4df23d12169740c819f3f696b23aa38be3a3c5
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Jan 10 23:23:54 2011 +0100
GtkThemingEngine: Fix handles rendering
The wrong class was being used, so the theming engine didn't
match it properly.
gtk/gtkpaned.c | 4 ++++
gtk/gtkstylecontext.h | 7 +++++++
gtk/gtkthemingengine.c | 4 ++--
3 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 1a7e51e..6962059 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -648,6 +648,7 @@ static void
gtk_paned_init (GtkPaned *paned)
{
GtkPanedPrivate *priv;
+ GtkStyleContext *context;
gtk_widget_set_has_window (GTK_WIDGET (paned), FALSE);
gtk_widget_set_can_focus (GTK_WIDGET (paned), TRUE);
@@ -684,6 +685,9 @@ gtk_paned_init (GtkPaned *paned)
priv->handle_pos.y = -1;
priv->drag_pos = -1;
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (paned));
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_PANE_SEPARATOR);
}
static void
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
index 309e275..00836d6 100644
--- a/gtk/gtkstylecontext.h
+++ b/gtk/gtkstylecontext.h
@@ -361,6 +361,13 @@ struct _GtkStyleContextClass
#define GTK_STYLE_CLASS_DND "dnd"
/**
+ * GTK_STYLE_CLASS_PANE_SEPARATOR:
+ *
+ * A CSS class for a pane separator, such as those in #GtkPaned.
+ */
+#define GTK_STYLE_CLASS_PANE_SEPARATOR "pane-separator"
+
+/**
* GTK_STYLE_CLASS_INFO:
*
* A widget class for an area displaying an informational message,
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index f0d93dc..061d6fb 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -2604,7 +2604,7 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
cairo_rectangle (cr, x, y, width, height);
cairo_fill (cr);
- if (gtk_theming_engine_has_class (engine, "grip"))
+ if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_GRIP))
{
GtkJunctionSides sides;
gint skip = -1;
@@ -2869,7 +2869,7 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
cairo_restore (cr);
}
- else if (gtk_theming_engine_has_class (engine, "paned"))
+ else if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_PANE_SEPARATOR))
{
if (width > height)
for (xx = x + width / 2 - 15; xx <= x + width / 2 + 15; xx += 5)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]