summaryrefslogtreecommitdiff
diff options
authorGord Allott <gord.allott@canonical.com>2010-09-16 20:33:54 +0100
committerGord Allott <gord.allott@canonical.com>2010-09-16 20:33:54 +0100
commitc945751ebdb3e07d16757af5dfe180067b972560 (patch)
tree8cf128cd76df9c274e20858e6b946add1b2f85d9
parent003f8d58e2cd0e051e1cdd3cfb8f8c133f26f390 (diff)
fixes lp:633084
(bzr r505.4.5)
-rw-r--r--unity-private/launcher/scroller-view.vala2
-rw-r--r--unity-private/launcher/scrollerchild.vala20
2 files changed, 18 insertions, 4 deletions
diff --git a/unity-private/launcher/scroller-view.vala b/unity-private/launcher/scroller-view.vala
index b1f5a3a14..437ebe2ed 100644
--- a/unity-private/launcher/scroller-view.vala
+++ b/unity-private/launcher/scroller-view.vala
@@ -1502,7 +1502,7 @@ namespace Unity.Launcher
if (index >= index_start_flat && index < index_end_flat)
{
change_child_position_rotation (child, h, 0.0f, immediate);
- h += nat_height + spacing;
+ h += 48 + spacing;
num_children_handled++;
if (index == index_start_flat)
diff --git a/unity-private/launcher/scrollerchild.vala b/unity-private/launcher/scrollerchild.vala
index c13bf4240..607364cf7 100644
--- a/unity-private/launcher/scrollerchild.vala
+++ b/unity-private/launcher/scrollerchild.vala
@@ -622,12 +622,22 @@ namespace Unity.Launcher
Clutter.ActorBox child_box = Clutter.ActorBox ();
+ // if we are rotated negatively, we need to work 'backwards'
+ float midpoint = 0;
+
//allocate the running indicator first
float width, height, n_width, n_height;
running_indicator.get_preferred_width (58, out n_width, out width);
running_indicator.get_preferred_height (58, out n_height, out height);
+ midpoint = (processed_icon.stored_height - height) / 2.0f;
+ if (rotation > 0)
+ {
+ midpoint = box.get_height () - midpoint - processed_icon.stored_ymod;
+ }
+
child_box.x1 = 0;
- child_box.y1 = (box.get_height () - height) / 2.0f;
+ child_box.y1 = midpoint;
+ //child_box.y1 = (box.get_height () - height) / 2.0f;
child_box.x2 = child_box.x1 + width;
child_box.y2 = child_box.y1 + height;
running_indicator.allocate (child_box, flags);
@@ -638,7 +648,7 @@ namespace Unity.Launcher
processed_icon.get_preferred_width (48, out width, out n_width);
processed_icon.get_preferred_height (48, out height, out n_height);
child_box.x1 = grabbed_push + (box.get_width () - width) / 2.0f;
- child_box.y1 = y;
+ child_box.y1 = 0;
child_box.x2 = child_box.x1 + 48;
child_box.y2 = child_box.y1 + height;
processed_icon.allocate (child_box, flags);
@@ -646,8 +656,12 @@ namespace Unity.Launcher
//allocate the active indicator
active_indicator.get_preferred_width (48, out n_width, out width);
active_indicator.get_preferred_height (48, out n_height, out height);
+ midpoint = (processed_icon.stored_height - height) / 2.0f;
+ if (rotation > 0)
+ midpoint = box.get_height () - midpoint - processed_icon.stored_ymod;
+
child_box.x1 = box.get_width () - width;
- child_box.y1 = (box.get_height () - height) / 2.0f;
+ child_box.y1 = midpoint;
child_box.x2 = child_box.x1 + width;
child_box.y2 = child_box.y1 + height;
active_indicator.allocate (child_box, flags);