From 027c8cdd4d06ec37f9a0ad4d52f98236a1da52ab Mon Sep 17 00:00:00 2001 From: Freeroot Date: Tue, 8 May 2018 16:18:42 +0200 Subject: [PATCH] don't move when CENTEREDMONITOR --- panel.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/panel.js b/panel.js index b6d1fe4..4a8754a 100644 --- a/panel.js +++ b/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);