switch: allow the user to toggle the switch by clicking on the handle

This commit is contained in:
Thomas Wood 2011-01-11 11:34:23 +00:00 committed by Matthias Clasen
parent 49a6e0c2b6
commit 0c6251d0d2

View File

@ -202,6 +202,15 @@ gtk_switch_button_release (GtkWidget *widget,
return TRUE;
}
/* toggle the switch if the handle was clicked but a drag had not been
* initiated */
if (!priv->is_dragging && !priv->in_press)
{
gtk_switch_set_active (GTK_SWITCH (widget), !priv->is_active);
return TRUE;
}
/* dragged toggle */
if (priv->is_dragging)
{