mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
GtkSwitch: Update handle_x in size-allocate
Since we are storing positions here that depend on the allocation, we need to update them in size-allocate. This fixes incorrect positioning of the handle if the switch is active initially. https://bugzilla.gnome.org/show_bug.cgi?id=734213
This commit is contained in:
parent
2e85046b8f
commit
1569952d0e
@ -474,6 +474,11 @@ gtk_switch_size_allocate (GtkWidget *widget,
|
||||
allocation->width,
|
||||
allocation->height);
|
||||
|
||||
if (priv->is_active)
|
||||
priv->handle_x = gtk_widget_get_allocated_width (widget) / 2;
|
||||
else
|
||||
priv->handle_x = 0;
|
||||
|
||||
_gtk_widget_set_simple_clip (widget);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user