[libdazzle] multi-paned: use gtk_widget_compute_expand()
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] multi-paned: use gtk_widget_compute_expand()
- Date: Thu, 22 Jun 2017 10:50:59 +0000 (UTC)
commit f36a2698cb85c3f0af7712660569320c6dbdc71f
Author: Christian Hergert <chergert redhat com>
Date: Thu Jun 22 03:50:40 2017 -0700
multi-paned: use gtk_widget_compute_expand()
We don't want to be using the widget-only flags for this, but instead the
computed version that checks the children.
src/widgets/dzl-multi-paned.c | 30 ++++++++----------------------
1 files changed, 8 insertions(+), 22 deletions(-)
---
diff --git a/src/widgets/dzl-multi-paned.c b/src/widgets/dzl-multi-paned.c
index b8c6797..3d8ed40 100644
--- a/src/widgets/dzl-multi-paned.c
+++ b/src/widgets/dzl-multi-paned.c
@@ -1298,14 +1298,11 @@ allocation_stage_expand (DzlMultiPaned *self,
* allocation stages in this case.
*/
- if (IS_HORIZONTAL (state->orientation))
+ if (gtk_widget_compute_expand (child->widget, state->orientation))
{
- if (gtk_widget_get_hexpand (child->widget))
+ if (IS_HORIZONTAL (state->orientation))
child->alloc.width = state->top_alloc.width;
- }
- else
- {
- if (gtk_widget_get_vexpand (child->widget))
+ else
child->alloc.height = state->top_alloc.height;
}
@@ -1329,16 +1326,8 @@ allocation_stage_expand (DzlMultiPaned *self,
if (!child->position_set)
{
- if (IS_HORIZONTAL (state->orientation))
- {
- if (gtk_widget_get_hexpand (child->widget))
- g_ptr_array_add (expanding, child);
- }
- else
- {
- if (gtk_widget_get_vexpand (child->widget))
- g_ptr_array_add (expanding, child);
- }
+ if (gtk_widget_compute_expand (child->widget, state->orientation))
+ g_ptr_array_add (expanding, child);
}
}
@@ -1422,18 +1411,15 @@ allocation_stage_expand (DzlMultiPaned *self,
if (!child->position_set)
{
- if (IS_HORIZONTAL (state->orientation))
+ if (gtk_widget_compute_expand (child->widget, state->orientation))
{
- if (gtk_widget_get_hexpand (child->widget))
+ if (IS_HORIZONTAL (state->orientation))
{
child->alloc.width += adjust;
state->avail_width -= adjust;
x_adjust += adjust;
}
- }
- else
- {
- if (gtk_widget_get_vexpand (child->widget))
+ else
{
child->alloc.height += adjust;
state->avail_height -= adjust;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]