static gboolean gtk_level_bar_draw (GtkWidget *widget, cairo_t *cr) { GtkLevelBar *self = GTK_LEVEL_BAR (widget); GtkStyleContext *context = gtk_widget_get_style_context (widget); gint width, height; width = gtk_widget_get_allocated_width (widget); height = gtk_widget_get_allocated_height (widget); gtk_style_context_save (context); gtk_style_context_add_class (context, GTK_STYLE_CLASS_TROUGH); gtk_render_background (context, cr, 0, 0, width, height); gtk_render_frame (context, cr, 0, 0, width, height); gtk_style_context_restore (context); gtk_level_bar_draw_fill (self, cr); return FALSE; }
static gboolean gtk_level_bar_draw (GtkWidget *widget, cairo_t *cr) { GtkLevelBar *self = GTK_LEVEL_BAR (widget); GtkStyleContext *context; gint width, height; width = gtk_widget_get_allocated_width (widget); height = gtk_widget_get_allocated_height (widget); context = gtk_widget_get_style_context (widget); gtk_style_context_save_to_node (context, self->priv->trough_node); gtk_render_background (context, cr, 0, 0, width, height); gtk_render_frame (context, cr, 0, 0, width, height); gtk_style_context_restore (context); gtk_level_bar_draw_fill (self, cr); return FALSE; }