[gtk/wip/otte/for-master: 2/5] revealer: Refactor code
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/for-master: 2/5] revealer: Refactor code
- Date: Wed, 9 Sep 2020 15:40:35 +0000 (UTC)
commit 0ad10ccf3993c66a05a3dc623e8bb86b0390a047
Author: Benjamin Otte <otte redhat com>
Date: Wed Sep 9 15:09:13 2020 +0200
revealer: Refactor code
Assign the values in the same place.
gtk/gtkrevealer.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkrevealer.c b/gtk/gtkrevealer.c
index ccaaef4143..b921ef6e44 100644
--- a/gtk/gtkrevealer.c
+++ b/gtk/gtkrevealer.c
@@ -457,8 +457,6 @@ gtk_revealer_size_allocate (GtkWidget *widget,
return;
}
- child_width = width;
- child_height = height;
hscale = get_child_size_scale (revealer, GTK_ORIENTATION_HORIZONTAL);
vscale = get_child_size_scale (revealer, GTK_ORIENTATION_VERTICAL);
if (hscale <= 0 || vscale <= 0)
@@ -494,11 +492,18 @@ gtk_revealer_size_allocate (GtkWidget *widget,
{
g_assert (vscale == 1.0);
child_width = MIN (100*width, ceil (width / hscale));
+ child_height = height;
}
else if (vscale < 1.0)
{
+ child_width = width;
child_height = MIN (100*height, ceil (height / vscale));
}
+ else
+ {
+ child_width = width;
+ child_height = height;
+ }
transform = NULL;
switch (effective_transition (revealer))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]