[gnome-shell/nbtk-introduction] Allocate children as wide as the scrolled area
- From: Owen Taylor <otaylor src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-shell/nbtk-introduction] Allocate children as wide as the scrolled area
- Date: Tue, 22 Sep 2009 18:44:20 +0000 (UTC)
commit 2ac82da232c1b8f3327d6fe95bb25bc0a2ad87b0
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Mon Sep 21 18:27:22 2009 -0400
Allocate children as wide as the scrolled area
When we are scrolling a vertical box horizontally , children should be
allocated horizontally as wide as the full horizontal scrolled area,
not just to the size of the "viewport". Similarly for a horizontal box.
http://bugzilla.moblin.org/show_bug.cgi?id=6312
src/nbtk/nbtk-box-layout.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/nbtk/nbtk-box-layout.c b/src/nbtk/nbtk-box-layout.c
index 530fbc4..86c7096 100644
--- a/src/nbtk/nbtk-box-layout.c
+++ b/src/nbtk/nbtk-box-layout.c
@@ -840,7 +840,10 @@ nbtk_box_layout_allocate (ClutterActor *actor,
child_box.y1 = (int)(0.5 + position);
child_box.y2 = (int)(0.5 + next_position);
child_box.x1 = content_box.x1;
- child_box.x2 = content_box.x2;
+ if (priv->hadjustment)
+ child_box.x2 = content_box.x1 + MAX (avail_width, natural_width);
+ else
+ child_box.x2 = content_box.x2;
_nbtk_allocate_fill (child, &child_box, xalign, yalign, xfill, yfill);
clutter_actor_allocate (child, &child_box, flags);
@@ -851,7 +854,10 @@ nbtk_box_layout_allocate (ClutterActor *actor,
child_box.x1 = (int)(0.5 + position);
child_box.x2 = (int)(0.5 + next_position);
child_box.y1 = content_box.y1;
- child_box.y2 = content_box.y2;
+ if (priv->vadjustment)
+ child_box.y2 = content_box.y1 + MAX (avail_height, natural_height);
+ else
+ child_box.y2 = content_box.y2;
_nbtk_allocate_fill (child, &child_box, xalign, yalign, xfill, yfill);
clutter_actor_allocate (child, &child_box, flags);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]