From 8c53a1f4a863e749642ecb3747ab506ee1353e7a Mon Sep 17 00:00:00 2001 From: Michele Date: Fri, 24 Aug 2012 23:25:32 +0200 Subject: [PATCH] Add max-height configuration via schema key. Still not exposed in settings GUI. --- dockedDash.js | 9 +++++++-- .../org.gnome.shell.extensions.dash-to-dock.gschema.xml | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dockedDash.js b/dockedDash.js index 366fc36b4..2fa623a55 100644 --- a/dockedDash.js +++ b/dockedDash.js @@ -216,6 +216,7 @@ dockedDash.prototype = { this.emit('box-changed'); })); this._settings.connect('changed::preferred-monitor', Lang.bind(this,this._resetPosition)); + this._settings.connect('changed::height-fraction', Lang.bind(this,this._updateYPosition)); }, @@ -472,8 +473,12 @@ dockedDash.prototype = { let availableHeight = this._monitor.height - unavailableTopSpace - unavailableBottomSpace; - this.actor.y = this._monitor.y + unavailableTopSpace; - this.actor.height = availableHeight; + let fraction = this._settings.get_double('height-fraction'); + if(fraction<0 || fraction >1) + fraction = 0.95; + + this.actor.height = Math.round( fraction * availableHeight); + this.actor.y = this._monitor.y + unavailableTopSpace + Math.round( (1-fraction)/2 * availableHeight); this.actor.y_align = St.Align.MIDDLE; this._updateStaticBox(); diff --git a/schemas/org.gnome.shell.extensions.dash-to-dock.gschema.xml b/schemas/org.gnome.shell.extensions.dash-to-dock.gschema.xml index 226717580..f0af8eb45 100644 --- a/schemas/org.gnome.shell.extensions.dash-to-dock.gschema.xml +++ b/schemas/org.gnome.shell.extensions.dash-to-dock.gschema.xml @@ -97,6 +97,10 @@ Basic compatibility with bolt extensions Make the extension work properly when bolt extensions is enabled + + 0.95 + Dock max height (fraction of available space) + -1 Monitor on which putting the dock