From ec36a0070e1e42bf62e610686df0e65c4b98df0b Mon Sep 17 00:00:00 2001 From: Abderrahim Kitouni Date: Fri, 25 Dec 2009 12:27:09 +0100 Subject: [PATCH] fix manual placement for RTL locales https://bugzilla.gnome.org/show_bug.cgi?id=584662 --- js/ui/overview.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/js/ui/overview.js b/js/ui/overview.js index 4db84d1f4..1f2ca9bf2 100644 --- a/js/ui/overview.js +++ b/js/ui/overview.js @@ -308,6 +308,7 @@ Overview.prototype = { relayout: function () { let primary = global.get_primary_monitor(); + let rtl = (St.Widget.get_default_direction () == St.TextDirection.RTL); this._recalculateGridSizes(); @@ -329,10 +330,19 @@ Overview.prototype = { this._workspacesHeight = Math.floor(displayGridRowHeight * workspaceRowsUsed - WORKSPACE_GRID_PADDING * (primary.height / primary.width) * 2); - this._workspacesX = displayGridColumnWidth + WORKSPACE_GRID_PADDING; + if (rtl) { + this._workspacesX = WORKSPACE_GRID_PADDING; + } else { + this._workspacesX = displayGridColumnWidth + WORKSPACE_GRID_PADDING; + } this._workspacesY = Math.floor(displayGridRowHeight + WORKSPACE_GRID_PADDING * (primary.height / primary.width)); - this._dash.actor.set_position(0, contentY); + if (rtl) { + this._dash.actor.set_position(primary.width - displayGridColumnWidth, contentY); + } else { + this._dash.actor.set_position(0, contentY); + } + this._dash.actor.set_size(displayGridColumnWidth, contentHeight); this._dash.searchArea.height = this._workspacesY - contentY; this._dash.sectionArea.height = this._workspacesHeight; @@ -356,6 +366,11 @@ Overview.prototype = { this._workspacesY); // Dynamic width this._paneContainer.height = this._workspacesHeight; + if (rtl) { + this._paneContainer.connect('notify::width', Lang.bind(this, function (paneContainer) { + paneContainer.x = this._dash.actor.x - (DEFAULT_PADDING + paneContainer.width); + })); + } this._transparentBackground.set_position(this._paneContainer.x, this._paneContainer.y); this._transparentBackground.set_size(primary.width - this._paneContainer.x,