mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Merge pull request #405 from freeroot/dont_move_when_CENTEREDMONITOR
don't move when CENTEREDMONITOR
This commit is contained in:
18
panel.js
18
panel.js
@@ -394,13 +394,21 @@ var dtpPanel = new Lang.Class({
|
||||
childBox.x1 = 0;
|
||||
childBox.x2 = sideWidth;
|
||||
}
|
||||
} else if (taskbarPosition == 'CENTEREDMONITOR' ) {
|
||||
if (this.panel.actor.get_text_direction() == Clutter.TextDirection.RTL) {
|
||||
childBox.x1 = allocWidth - Math.min(Math.floor(sideWidth), leftNaturalWidth);
|
||||
childBox.x2 = allocWidth;
|
||||
} else {
|
||||
childBox.x1 = 0;
|
||||
childBox.x2 = Math.min(Math.floor(sideWidth), leftNaturalWidth);
|
||||
}
|
||||
} else {
|
||||
if (this.panel.actor.get_text_direction() == Clutter.TextDirection.RTL) {
|
||||
childBox.x1 = allocWidth - leftNaturalWidth;
|
||||
childBox.x2 = allocWidth;
|
||||
} else {
|
||||
childBox.x1 = 0;
|
||||
childBox.x2 =leftNaturalWidth;
|
||||
childBox.x2 = leftNaturalWidth;
|
||||
}
|
||||
}
|
||||
this.panel._leftBox.allocate(childBox, flags, true);
|
||||
@@ -415,6 +423,14 @@ var dtpPanel = new Lang.Class({
|
||||
childBox.x1 = allocWidth - centerNaturalWidth - rightNaturalWidth;
|
||||
childBox.x2 = childBox.x1 + centerNaturalWidth;
|
||||
}
|
||||
} else if (taskbarPosition == 'CENTEREDMONITOR' ) {
|
||||
if (this.panel.actor.get_text_direction() == Clutter.TextDirection.RTL) {
|
||||
childBox.x1 = Math.ceil(sideWidth);
|
||||
childBox.x2 = childBox.x1 + centerNaturalWidth;
|
||||
} else {
|
||||
childBox.x1 = allocWidth - centerNaturalWidth - Math.ceil(sideWidth);
|
||||
childBox.x2 = childBox.x1 + centerNaturalWidth;
|
||||
}
|
||||
} else {
|
||||
if (this.panel.actor.get_text_direction() == Clutter.TextDirection.RTL) {
|
||||
childBox.x1 = Math.max(rightNaturalWidth, rightSideWidth);
|
||||
|
||||
Reference in New Issue
Block a user