[gnome-shell] boxpointer: Clean up reposition
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] boxpointer: Clean up reposition
- Date: Fri, 21 Dec 2012 17:25:12 +0000 (UTC)
commit b14b3ab27681d7fc9bff8d97153474c64f7487a3
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Fri Dec 21 09:05:34 2012 -0500
boxpointer: Clean up reposition
Given that it's modifying state, there's no reason it can't be
using it instead. This makes it easier to use, so we aren't passing
in a bunch of instance variables every time.
https://bugzilla.gnome.org/show_bug.cgi?id=690608
js/ui/boxpointer.js | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js
index 01bc2c8..db82449 100644
--- a/js/ui/boxpointer.js
+++ b/js/ui/boxpointer.js
@@ -220,7 +220,7 @@ const BoxPointer = new Lang.Class({
this.bin.allocate(childBox, flags);
if (this._sourceActor && this._sourceActor.mapped) {
- this._reposition(this._sourceActor, this._arrowAlignment);
+ this._reposition();
if (this._shouldFlip()) {
switch (this._arrowSide) {
@@ -237,7 +237,7 @@ const BoxPointer = new Lang.Class({
this._arrowSide = St.Side.LEFT;
break;
}
- this._reposition(this._sourceActor, this._arrowAlignment);
+ this._reposition();
}
}
},
@@ -417,7 +417,7 @@ const BoxPointer = new Lang.Class({
this._sourceActor = sourceActor;
this._arrowAlignment = alignment;
- this._reposition(sourceActor, alignment);
+ this._reposition();
},
setSourceAlignment: function(alignment) {
@@ -429,7 +429,10 @@ const BoxPointer = new Lang.Class({
this.setPosition(this._sourceActor, this._arrowAlignment);
},
- _reposition: function(sourceActor, alignment) {
+ _reposition: function() {
+ let sourceActor = this._sourceActor;
+ let alignment = this._arrowAlignment;
+
// Position correctly relative to the sourceActor
let sourceNode = sourceActor.get_theme_node();
let sourceContentBox = sourceNode.get_content_box(sourceActor.get_allocation_box());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]