[gtk+] Make GtkAccelLabel use GtkStyleContext.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Make GtkAccelLabel use GtkStyleContext.
- Date: Fri, 24 Dec 2010 18:49:43 +0000 (UTC)
commit 1cecb105845658c9038da11c61ce242c412bd64d
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Dec 21 14:47:17 2010 +0100
Make GtkAccelLabel use GtkStyleContext.
gtk/gtkaccellabel.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c
index 6e5f06a..d86b003 100644
--- a/gtk/gtkaccellabel.c
+++ b/gtk/gtkaccellabel.c
@@ -392,6 +392,7 @@ gtk_accel_label_draw (GtkWidget *widget,
if (allocation.width >= requisition.width + ac_width)
{
+ GtkStyleContext *context;
PangoLayout *label_layout;
PangoLayout *accel_layout;
GtkLabel *label = GTK_LABEL (widget);
@@ -400,6 +401,7 @@ gtk_accel_label_draw (GtkWidget *widget,
gint y;
gint xpad;
+ context = gtk_widget_get_style_context (widget);
label_layout = gtk_label_get_layout (GTK_LABEL (accel_label));
cairo_save (cr);
@@ -440,14 +442,12 @@ gtk_accel_label_draw (GtkWidget *widget,
y += get_first_baseline (label_layout) - get_first_baseline (accel_layout) - allocation.y;
- gtk_paint_layout (gtk_widget_get_style (widget),
- cr,
- gtk_widget_get_state (widget),
- FALSE,
- widget,
- "accellabel",
- x, y,
- accel_layout);
+ gtk_style_context_save (context);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_ACCELERATOR);
+ gtk_style_context_set_state (context, gtk_widget_get_state_flags (widget));
+
+ gtk_render_layout (context, cr, x, y, accel_layout);
+ gtk_style_context_restore (context);
g_object_unref (accel_layout);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]