Skip to content

Commit

Permalink
Restore initial taskbar index and clarify clock position
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesg99 committed Jun 8, 2018
1 parent a0f0217 commit f1ce453
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
8 changes: 4 additions & 4 deletions Settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -3308,10 +3308,10 @@
<property name="can_focus">False</property>
<property name="valign">center</property>
<items>
<item id="BUTTONSLEFT" translatable="yes">Left of panel buttons</item>
<item id="BUTTONSRIGHT" translatable="yes">Right of panel buttons</item>
<item id="STATUSLEFT" translatable="yes">Left of status menu</item>
<item id="STATUSRIGHT" translatable="yes">Right of status menu</item>
<item id="BUTTONSLEFT" translatable="yes">Left of plugin icons</item>
<item id="BUTTONSRIGHT" translatable="yes">Right of plugin icons</item>
<item id="STATUSLEFT" translatable="yes">Left of system indicators</item>
<item id="STATUSRIGHT" translatable="yes">Right of system indicators</item>
<item id="TASKBARLEFT" translatable="yes">Left of taskbar</item>
<item id="TASKBARRIGHT" translatable="yes">Right of taskbar</item>
</items>
Expand Down
19 changes: 6 additions & 13 deletions panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ var dtpPanel = new Lang.Class({
this.taskbar = new Taskbar.taskbar(this._dtpSettings);
Main.overview.dashIconSize = this.taskbar.iconSize;

this.container.insert_child_at_index( this.taskbar.actor, 0 );
this.container.insert_child_at_index( this.taskbar.actor, 2 );

this._oldLeftBoxStyle = this.panel._leftBox.get_style();
this._oldCenterBoxStyle = this.panel._centerBox.get_style();
Expand Down Expand Up @@ -558,7 +558,7 @@ var dtpPanel = new Lang.Class({
let dateMenuContainer = this.panel.statusArea.dateMenu.container;
let parent = dateMenuContainer.get_parent();
let destination;
let leftSibling = null;
let refSibling = null;

if (!parent) {
return;
Expand All @@ -567,26 +567,19 @@ var dtpPanel = new Lang.Class({
if (loc.indexOf('BUTTONS') == 0) {
destination = this.panel._centerBox;
} else if (loc.indexOf('STATUS') == 0) {
leftSibling = this.panel.statusArea.aggregateMenu.container;
refSibling = this.panel.statusArea.aggregateMenu.container;
destination = this.panel._rightBox;
} else { //TASKBAR
leftSibling = this.taskbar.actor;
destination = leftSibling.get_parent();
refSibling = this.taskbar.actor;
destination = refSibling.get_parent();
}

if (parent != destination) {
parent.remove_actor(dateMenuContainer);
destination.add_actor(dateMenuContainer);
}

if (loc.indexOf('RIGHT') > 0) {
destination.set_child_above_sibling(dateMenuContainer, leftSibling);
} else {
destination.set_child_at_index(
dateMenuContainer,
leftSibling != this.taskbar.actor && destination.get_children()[0] == this.taskbar.actor ? 1 : 0
);
}
destination['set_child_' + (loc.indexOf('RIGHT') > 0 ? 'above' : 'below') + '_sibling'](dateMenuContainer, refSibling);
},

_displayShowDesktopButton: function (isVisible) {
Expand Down

0 comments on commit f1ce453

Please sign in to comment.