[gtk+] popover: Simplify gtk_popover_measure
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] popover: Simplify gtk_popover_measure
- Date: Sun, 5 Feb 2017 14:02:15 +0000 (UTC)
commit 78a36cf4bb5ad0678de7e40b90a2504191d44f18
Author: Timm Bäder <mail baedert org>
Date: Sun Feb 5 13:57:29 2017 +0100
popover: Simplify gtk_popover_measure
gtk/gtkpopover.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 7277aca..94311ab 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -1272,9 +1272,10 @@ gtk_popover_measure (GtkWidget *widget,
if (child != NULL)
{
+ int child_size = -1;
+
if (for_size >= 0)
{
- int child_size;
GdkRectangle child_rect;
if (orientation == GTK_ORIENTATION_HORIZONTAL)
@@ -1287,14 +1288,9 @@ gtk_popover_measure (GtkWidget *widget,
gtk_popover_get_rect_for_size (popover, 0, for_size, &child_rect);
child_size = child_rect.height;
}
-
- gtk_widget_measure (child, orientation, child_size, minimum, natural, NULL, NULL);
-
- }
- else
- {
- gtk_widget_measure (child, orientation, -1, minimum, natural, NULL, NULL);
}
+
+ gtk_widget_measure (child, orientation, child_size, minimum, natural, NULL, NULL);
}
minimal_size = get_minimal_size (popover, orientation);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]