Commit 1cecb105 authored by Carlos Garnacho's avatar Carlos Garnacho

Make GtkAccelLabel use GtkStyleContext.

parent 5e74427d
......@@ -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),
gtk_widget_get_state (widget),
x, y,
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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment