Skip to content

Commit

Permalink
Add max-height configuration via schema key.
Browse files Browse the repository at this point in the history
Still not exposed in settings GUI.
  • Loading branch information
micheleg committed Sep 1, 2012
1 parent 6850517 commit 8c53a1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dockedDash.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));

},

Expand Down Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions schemas/org.gnome.shell.extensions.dash-to-dock.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@
<summary>Basic compatibility with bolt extensions</summary>
<description>Make the extension work properly when bolt extensions is enabled</description>
</key>
<key type="d" name="height-fraction">
<default>0.95</default>
<summary>Dock max height (fraction of available space)</summary>
</key>
<key type="i" name="preferred-monitor">
<default>-1</default>
<summary>Monitor on which putting the dock</summary>
Expand Down

0 comments on commit 8c53a1f

Please sign in to comment.