forked from AuroraMiddleware/gtk
switch: Use gtk_widget_contains()
This commit is contained in:
parent
bcced800ea
commit
801d69017a
@ -205,13 +205,10 @@ gtk_switch_multipress_gesture_released (GtkGestureMultiPress *gesture,
|
|||||||
GtkSwitch *sw)
|
GtkSwitch *sw)
|
||||||
{
|
{
|
||||||
GdkEventSequence *sequence;
|
GdkEventSequence *sequence;
|
||||||
GdkRectangle own_alloc;
|
|
||||||
|
|
||||||
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
|
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
|
||||||
|
|
||||||
gtk_widget_get_own_allocation (GTK_WIDGET (sw), &own_alloc);
|
if (gtk_widget_contains (GTK_WIDGET (sw), x, y) &&
|
||||||
|
|
||||||
if (gdk_rectangle_contains_point (&own_alloc, x, y) &&
|
|
||||||
gtk_gesture_handles_sequence (GTK_GESTURE (gesture), sequence))
|
gtk_gesture_handles_sequence (GTK_GESTURE (gesture), sequence))
|
||||||
gtk_switch_begin_toggle_animation (sw);
|
gtk_switch_begin_toggle_animation (sw);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user