GtkButton: Notify on prelight state change.

This commit is contained in:
Carlos Garnacho
2010-10-05 10:56:52 +02:00
parent 908babd8ae
commit 5b11d14a49

View File

@ -1746,6 +1746,18 @@ gtk_button_enter_notify (GtkWidget *widget,
{
priv->in_button = TRUE;
gtk_button_enter (button);
if (gtk_widget_get_realized (widget) &&
gtk_widget_is_drawable (widget))
{
GtkStyleContext *context;
context = gtk_widget_get_style_context (widget);
gtk_style_context_notify_state_change (context,
gtk_widget_get_window (widget),
NULL, GTK_STATE_PRELIGHT,
button->in_button);
}
}
return FALSE;
@ -1764,6 +1776,18 @@ gtk_button_leave_notify (GtkWidget *widget,
{
priv->in_button = FALSE;
gtk_button_leave (button);
if (gtk_widget_get_realized (widget) &&
gtk_widget_is_drawable (widget))
{
GtkStyleContext *context;
context = gtk_widget_get_style_context (widget);
gtk_style_context_notify_state_change (context,
gtk_widget_get_window (widget),
NULL, GTK_STATE_PRELIGHT,
button->in_button);
}
}
return FALSE;