forked from AuroraMiddleware/gtk
switch: allow the user to toggle the switch by clicking on the handle
This commit is contained in:
parent
49a6e0c2b6
commit
0c6251d0d2
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user