[gtk] switch: Shorten size_allocate impl a bit
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] switch: Shorten size_allocate impl a bit
- Date: Tue, 27 Nov 2018 05:18:16 +0000 (UTC)
commit eeeefb40c7b84f0afc891898e57ce30ef3ca828a
Author: Timm Bäder <mail baedert org>
Date: Tue Nov 20 18:11:50 2018 +0100
switch: Shorten size_allocate impl a bit
gtk/gtkswitch.c | 13 +++++--------
1 file 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]