label: Use the widget state flags as a base for drawing

This commit is contained in:
Rui Matos 2011-12-19 15:21:55 +00:00
parent 02dd7df653
commit 5b4cc2f0b6

View File

@ -4062,10 +4062,7 @@ gtk_label_draw (GtkWidget *widget,
gdk_cairo_region (cr, clip);
cairo_clip (cr);
state = GTK_STATE_FLAG_SELECTED;
if (gtk_widget_has_focus (widget))
state |= GTK_STATE_FLAG_FOCUSED;
state |= GTK_STATE_FLAG_SELECTED;
gtk_style_context_get_color (context, state, &fg_color);
gtk_style_context_get_background_color (context, state, &bg_color);
@ -4131,9 +4128,9 @@ gtk_label_draw (GtkWidget *widget,
text_color = link_color;
if (info->link_clicked)
state = GTK_STATE_FLAG_ACTIVE;
state |= GTK_STATE_FLAG_ACTIVE;
else
state = GTK_STATE_FLAG_PRELIGHT;
state |= GTK_STATE_FLAG_PRELIGHT;
gtk_style_context_get_background_color (context, state, &bg_color);