mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
boxpointer: Swap arrow alignment on RTL
The current code uses the arrow alignment to align the menu between
the top/left (0) and bottom/right(1), regardless of the text direction.
Instead of adjusting code everywhere, reinterpret the parameter
to refer to start/end instead, and swap the alignment with an
RTL text direction.
Credit to Sebastian Keller for spotting the cause of the issue.
Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5261
Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7356
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3150>
(cherry picked from commit 4e70315fbb)
This commit is contained in:
parent
80f4b3c97d
commit
b7ddc8527f
1 changed files with 3 additions and 0 deletions
|
|
@ -525,6 +525,9 @@ var BoxPointer = GObject.registerClass({
|
||||||
switch (this._arrowSide) {
|
switch (this._arrowSide) {
|
||||||
case St.Side.TOP:
|
case St.Side.TOP:
|
||||||
case St.Side.BOTTOM:
|
case St.Side.BOTTOM:
|
||||||
|
if (this.text_direction === Clutter.TextDirection.RTL)
|
||||||
|
alignment = 1.0 - alignment;
|
||||||
|
|
||||||
resX = sourceCenterX - (halfMargin + (natWidth - margin) * alignment);
|
resX = sourceCenterX - (halfMargin + (natWidth - margin) * alignment);
|
||||||
|
|
||||||
resX = Math.max(resX, workarea.x + padding);
|
resX = Math.max(resX, workarea.x + padding);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue