Skip to content

Commit

Permalink
Overview hot corner and overview icon can now be enabled/disabled via…
Browse files Browse the repository at this point in the history
… gsettings
  • Loading branch information
clefebvre committed Dec 30, 2011
1 parent f6291a7 commit 4e2f692
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 3 deletions.
16 changes: 14 additions & 2 deletions data/org.cinnamon.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,19 @@
<key type="b" name="panel-autohide">
<default>false</default>
<summary>Auto-hide panel</summary>
<description>Whether the panel autohides or not</description>
<description>Whether the panel autohides or not.</description>
</key>

<key name="overview-corner-visible" type="b">
<default>true</default>
<summary>Enable or disable the overview corner icon</summary>
<description>Whether the overview icon is visible or not.</description>
</key>

<key name="overview-corner-hover" type="b">
<default>true</default>
<summary>Enable or disable the overview hot corner</summary>
<description>Whether the overview hot corner is enabled or not.</description>
</key>

<key type="as" name="panel-launchers">
Expand Down Expand Up @@ -114,4 +126,4 @@
<description>The filename for recorded screencasts will be a unique filename based on the current date, and use this extension. It should be changed when recording to a different container format.</description>
</key>
</schema>
</schemalist>
</schemalist>
18 changes: 17 additions & 1 deletion data/org.cinnamon.gschema.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,23 @@
<default>false</default>
<_summary>Auto-hide panel</_summary>
<_description>
Whether the panel autohides or not
Whether the panel autohides or not.
</_description>
</key>

<key name="overview-corner-visible" type="b">
<default>true</default>
<_summary>Enable or disable the overview corner icon</_summary>
<_description>
Whether the overview icon is visible or not.
</_description>
</key>

<key name="overview-corner-hover" type="b">
<default>true</default>
<_summary>Enable or disable the overview hot corner</_summary>
<_description>
Whether the overview hot corner is enabled or not.
</_description>
</key>

Expand Down
36 changes: 36 additions & 0 deletions js/ui/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ LayoutManager.prototype = {
this._monitorsChanged();
this._chrome.addActor(this._hotCorner.actor);
global.settings.connect("changed::panel-autohide", Lang.bind(this, this._onPanelAutoHideChanged));
global.settings.connect("changed::overview-corner-visible", Lang.bind(this, this._onOverviewCornerVisibleChanged));
global.settings.connect("changed::overview-corner-hover", Lang.bind(this, this._onOverviewCornerHoverChanged));
},

// This is called by Main after everything else is constructed;
Expand All @@ -94,6 +96,26 @@ LayoutManager.prototype = {
this._chrome.modifyActorParams(this.panelBox, { affectsStruts: true });
}
},

_onOverviewCornerVisibleChanged: function() {
let visible = global.settings.get_boolean("overview-corner-visible");
if (visible) {
this.overviewCorner.show();
}
else {
this.overviewCorner.hide();
}
},

_onOverviewCornerHoverChanged: function() {
let enabled = global.settings.get_boolean("overview-corner-hover");
if (enabled) {
this._hotCorner.actor.show();
}
else {
this._hotCorner.actor.hide();
}
},

_updateMonitors: function() {
let screen = global.screen;
Expand Down Expand Up @@ -180,6 +202,20 @@ LayoutManager.prototype = {
this.overviewCorner.set_position(this.primaryMonitor.x + 1, this.primaryMonitor.y + 1);
this.overviewCorner.set_size(32, 32);

if (global.settings.get_boolean("overview-corner-hover")) {
this._hotCorner.actor.show();
}
else {
this._hotCorner.actor.hide();
}

if (global.settings.get_boolean("overview-corner-visible")) {
this.overviewCorner.show();
}
else {
this.overviewCorner.hide();
}

// Need to use GSettings to get the panel height instead of hard-coding it
this.panelBox.set_position(this.bottomMonitor.x, this.bottomMonitor.y + this.bottomMonitor.height - 25);
this.panelBox.set_size(this.bottomMonitor.width, 25);
Expand Down

0 comments on commit 4e2f692

Please sign in to comment.