Bug 372717 - on rtl langs the search bar isn't in the right position
Summary: on rtl langs the search bar isn't in the right position
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Application Menu (Kicker) (show other bugs)
Version: 5.8.3
Platform: unspecified All
: NOR normal
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-21 06:14 UTC by ttv200
Modified: 2016-12-15 22:53 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
the problem (36.46 KB, image/png)
2016-11-21 06:14 UTC, ttv200
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ttv200 2016-11-21 06:14:56 UTC
Created attachment 102355 [details]
the problem

see attachment
Comment 1 Marco Martin 2016-11-21 14:29:26 UTC
this doesn't seem reproducible with just passing --reverse argument (all is correctly flipped, the search bar doesn't overlap logout button
Comment 2 ttv200 2016-11-21 15:14:59 UTC
I'll try to check it on virtual machine with the last KDE Neon later
Comment 3 Eike Hein 2016-11-21 17:42:45 UTC
Hmm it's always possible things bitrot, but I usually do test with rtl ...
Comment 4 ttv200 2016-11-23 18:55:08 UTC
I Install KDE Neon on virtual machine
I try:
killall plasmashell
kstart plasmashell --reverse

The search bar still overlap logout button.

and secondly I try to set the system to Hebrew
and the search bar still overlap...
Comment 5 ttv200 2016-11-30 12:52:22 UTC
I found the problem and I write a patch:

In plasma-desktop git, applets/kicker/package/contents/ui/MenuRepresentation.qml

Row 62:
LayoutMirroring.enabled: ((plasmoid.location == PlasmaCore.Types.RightEdge)
    || (Qt.application.layoutDirection == Qt.RightToLeft))

Row 353:
the search field:
when: (plasmoid.location == PlasmaCore.Types.RightEdge
    || (plasmoid.location != PlasmaCore.Types.RightEdge && mainRow.LayoutMirroring.enabled))

The idea was if the widget is on the right edge the layout will mirrored (the side bar be on the right - try it and understand)
This cause problem - the search field overlap logout button on RTL lang
Because when the LayoutMirroring.enabled (on LTR when RightEdge and on RTL langs) all the left and right switched
* (363) "anchors.right: parent.right" become "anchors.left: parent.left"
* (368) "anchors.rightMargin: ..." become "anchors.LeftMargin: ..."

So I think and I write patch with this thought:
Like that LTE with RightEdge is mirrored so RTL with LeftEdge should be (not mirrored)

The Patch:

Replace rows 62-63 with:
LayoutMirroring.enabled: ((plasmoid.location == PlasmaCore.Types.RightEdge)
    || (Qt.application.layoutDirection == Qt.RightToLeft && plasmoid.location != PlasmaCore.Types.LeftEdge))

Replace rows 353-354 with:
when: (plasmoid.location == PlasmaCore.Types.RightEdge && Qt.application.layoutDirection == Qt.LeftToRight)
    || (plasmoid.location == PlasmaCore.Types.LeftEdge && Qt.application.layoutDirection == Qt.RightToLeft)

I tried the patch on my system and check LTR and RTL with right and left edged panels

Can you apply the patch?
Comment 6 ttv200 2016-11-30 22:00:49 UTC
I found out how to do it myself...

https://phabricator.kde.org/D3553
Comment 7 Christoph Feck 2016-11-30 22:25:45 UTC
Please only close this once the patch is committed.
Comment 8 ttv200 2016-12-15 22:53:42 UTC
Committed
https://phabricator.kde.org/D3553