button: Allow :hover on insensitive buttons

You can still hover a mouse on insensitive elements; it's up to the
theme to disable that.
This is in line with the HTML/CSS interpretation of :hover.

Insensitive elements still cannot be clicked.

https://bugzilla.gnome.org/show_bug.cgi?id=719486
This commit is contained in:
Benjamin Otte 2013-12-07 01:29:56 +01:00
parent 0bff206915
commit b6f9ce8a73

View File

@ -2044,8 +2044,7 @@ gtk_button_leave_notify (GtkWidget *widget,
GtkButtonPrivate *priv = button->priv;
if ((event->window == button->priv->event_window) &&
(event->detail != GDK_NOTIFY_INFERIOR) &&
(gtk_widget_get_sensitive (widget)))
(event->detail != GDK_NOTIFY_INFERIOR))
{
priv->in_button = FALSE;
g_signal_emit (button, button_signals[LEAVE], 0);
@ -2104,8 +2103,9 @@ static void
gtk_real_button_released (GtkButton *button)
{
gtk_button_do_release (button,
button->priv->in_button ||
touch_release_in_button (button));
gtk_widget_is_sensitive (GTK_WIDGET (button)) &&
(button->priv->in_button ||
touch_release_in_button (button)));
}
static void
@ -2703,13 +2703,9 @@ gtk_button_state_changed (GtkWidget *widget,
GtkStateType previous_state)
{
GtkButton *button = GTK_BUTTON (widget);
GtkButtonPrivate *priv = button->priv;
if (!gtk_widget_is_sensitive (widget))
{
priv->in_button = FALSE;
gtk_button_do_release (button, FALSE);
}
gtk_button_do_release (button, FALSE);
}
static void