diff options
author | Timm Bäder <mail@baedert.org> | 2018-11-20 18:11:50 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2018-11-27 05:37:38 +0100 |
commit | eeeefb40c7b84f0afc891898e57ce30ef3ca828a (patch) | |
tree | 670e47050ac4c6c3d52d483e99fd866f19360a4a /gtk/gtkswitch.c | |
parent | 97d8676b401101a8f2dd5d96e2efd3b00a46b04f (diff) | |
download | gtk+-eeeefb40c7b84f0afc891898e57ce30ef3ca828a.tar.gz |
switch: Shorten size_allocate impl a bit
Diffstat (limited to 'gtk/gtkswitch.c')
-rw-r--r-- | gtk/gtkswitch.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c index f8c235fe69..a1a1bcdc9b 100644 --- a/gtk/gtkswitch.c +++ b/gtk/gtkswitch.c @@ -324,16 +324,13 @@ gtk_switch_size_allocate (GtkWidget *widget, GtkSwitch *self = GTK_SWITCH (widget); GtkSwitchPrivate *priv = gtk_switch_get_instance_private (self); GtkAllocation child_alloc; - GtkAllocation slider_alloc; int min; - slider_alloc.x = round (priv->handle_pos * (width / 2)); - slider_alloc.y = 0; - slider_alloc.width = width / 2; - slider_alloc.height = height; - - gtk_widget_size_allocate (priv->slider, &slider_alloc, -1); - + gtk_widget_size_allocate (priv->slider, + &(GtkAllocation) { + round (priv->handle_pos * (width / 2)), 0, + width / 2, height + }, -1); /* Center ON label in left half */ gtk_widget_measure (priv->on_label, GTK_ORIENTATION_HORIZONTAL, -1, &min, NULL, NULL, NULL); |