[gnome-shell] [lightbox] Fix logic; get_children() returns children bottom-to-top
- From: Dan Winship <danw src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-shell] [lightbox] Fix logic; get_children() returns children bottom-to-top
- Date: Tue, 22 Sep 2009 22:11:36 +0000 (UTC)
commit 0b6d09bbe2bd06ca33de97ca51ba89a0826049e3
Author: Dan Winship <danw gnome org>
Date: Tue Sep 22 17:48:44 2009 -0400
[lightbox] Fix logic; get_children() returns children bottom-to-top
js/ui/lightbox.js | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/js/ui/lightbox.js b/js/ui/lightbox.js
index 17ae9a7..b3379fa 100644
--- a/js/ui/lightbox.js
+++ b/js/ui/lightbox.js
@@ -74,20 +74,20 @@ Lightbox.prototype = {
let myIndex = children.indexOf(this.actor);
let newChildIndex = children.indexOf(newChild);
- if (newChildIndex < myIndex) {
+ if (newChildIndex > myIndex) {
// The child was added above the shade (presumably it was
// made the new top-most child). Move it below the shade,
// and add it to this._children as the new topmost actor.
newChild.lower(this.actor);
- this._children.unshift(newChild);
- } else if (newChildIndex == children.length - 1) {
- // Bottom of stack
this._children.push(newChild);
+ } else if (newChildIndex == 0) {
+ // Bottom of stack
+ this._children.unshift(newChild);
} else {
// Somewhere else; insert it into the correct spot
- let nextChild = this._children.indexOf(children[newChildIndex + 1]);
- if (nextChild != -1) // paranoia
- this._children.splice(nextChild, 0, newChild);
+ let prevChild = this._children.indexOf(children[newChildIndex - 1]);
+ if (prevChild != -1) // paranoia
+ this._children.splice(prevChild + 1, 0, newChild);
}
},
@@ -119,7 +119,7 @@ Lightbox.prototype = {
// sibling of the to-be-lowered one.
let below = this.actor;
- for (let i = 0; i < this._children.length; i++) {
+ for (let i = this._children.length - 1; i >= 0; i--) {
if (this._children[i] == window)
this._children[i].raise_top();
else if (this._children[i] == this._highlighted)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]