[gnome-shell/gnome-41] dash: Fix drag placeholder position in RTL
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-41] dash: Fix drag placeholder position in RTL
- Date: Sun, 20 Mar 2022 20:21:29 +0000 (UTC)
commit d003a8603b7ccd15faf0e95d9ae936ac8b625612
Author: Florian Müllner <fmuellner gnome org>
Date: Sat Feb 26 18:35:47 2022 +0100
dash: Fix drag placeholder position in RTL
The position corresponds to a child index, which means it must
be mirrored when starting to count from the right.
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4574
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2219>
(cherry picked from commit 4735193456e525edada2bbc5ab11b609e4eabd81)
js/ui/dash.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/dash.js b/js/ui/dash.js
index c3b9a3e05d..f35cc2e252 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -875,10 +875,12 @@ var Dash = GObject.registerClass({
}
let pos;
- if (!this._emptyDropTarget)
- pos = Math.floor(x * numChildren / boxWidth);
+ if (this._emptyDropTarget)
+ pos = 0; // always insert at the start when dash is empty
+ else if (this.text_direction === Clutter.TextDirection.RTL)
+ pos = numChildren - Math.floor(x * numChildren / boxWidth);
else
- pos = 0; // always insert at the top when dash is empty
+ pos = Math.floor(x * numChildren / boxWidth);
// Put the placeholder after the last favorite if we are not
// in the favorites zone
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]