[gnome-shell/modekill: 8/10] overview: Center the dash vertically
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/modekill: 8/10] overview: Center the dash vertically
- Date: Fri, 17 Aug 2012 17:36:35 +0000 (UTC)
commit 568ef319f1a15ec0f0462d793536ce08c232ba8f
Author: Joost Verdoorn <jpverdoorn gmail com>
Date: Mon Aug 13 16:18:38 2012 +0200
overview: Center the dash vertically
https://bugzilla.gnome.org/show_bug.cgi?id=682109
js/ui/dash.js | 3 +--
js/ui/overview.js | 15 +++++++--------
js/ui/viewSelector.js | 2 --
3 files changed, 8 insertions(+), 12 deletions(-)
---
diff --git a/js/ui/dash.js b/js/ui/dash.js
index e438c69..eb46662 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -331,8 +331,7 @@ const Dash = new Lang.Class({
this._container.add(this._showAppsIcon.actor);
- this.actor = new St.Bin({ child: this._container,
- y_align: St.Align.START });
+ this.actor = new St.Bin({ child: this._container });
this.actor.connect('notify::height', Lang.bind(this,
function() {
if (this._maxHeight != this.actor.height)
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 664ce90..bb1d42a 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -206,7 +206,6 @@ const Overview = new Lang.Class({
RemoteSearch.loadRemoteSearchProviders(Lang.bind(this, this.addSearchProvider));
// TODO - recalculate everything when desktop size changes
- this._dash.actor.add_constraint(this._viewSelector.constrainY);
this._dash.actor.add_constraint(this._viewSelector.constrainHeight);
this.dashIconSize = this._dash.iconSize;
this._dash.connect('icon-size-changed',
@@ -498,12 +497,7 @@ const Overview = new Lang.Class({
let searchY = contentY + this._spacing;
let dashWidth = Math.round(DASH_SPLIT_FRACTION * primary.width);
- let viewWidth = primary.width - dashWidth - this._spacing;
- let viewHeight = contentHeight - 2 * this._spacing - searchHeight;
- let viewY = contentY + this._spacing + searchHeight;
- let viewX = rtl ? 0 : dashWidth + this._spacing;
-
- // Set the dash's x position - y is handled by a constraint
+ let dashY = searchY + searchHeight + this._spacing;
let dashX;
if (rtl) {
this._dash.actor.set_anchor_point_from_gravity(Clutter.Gravity.NORTH_EAST);
@@ -511,9 +505,14 @@ const Overview = new Lang.Class({
} else {
dashX = 0;
}
- this._dash.actor.set_x(dashX);
+
+ let viewX = rtl ? 0 : dashWidth + this._spacing;
+ let viewY = searchY + searchHeight + this._spacing;
+ let viewWidth = primary.width - dashWidth - this._spacing;
+ let viewHeight = contentHeight - this._spacing - viewY;
this._searchEntry.set_position(searchX, searchY);
+ this._dash.actor.set_position(dashX, dashY);
this._viewSelector.actor.set_position(viewX, viewY);
this._viewSelector.actor.set_size(viewWidth, viewHeight);
},
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 55fa087..c33ad64 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -419,8 +419,6 @@ const ViewSelector = new Lang.Class({
// to use position and height properties directly, outside code would
// need to ensure that the content is properly allocated before
// accessing the properties.
- this.constrainY = new Clutter.BindConstraint({ source: this._pageArea,
- coordinate: Clutter.BindCoordinate.Y });
this.constrainHeight = new Clutter.BindConstraint({ source: this._pageArea,
coordinate: Clutter.BindCoordinate.HEIGHT });
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]