Closed xiaoyifang closed 2 days ago
The left/right relationship of forward/backward is unchanged, but the position of the forward/backward combo is moved to another side of the topbar.
Arabic:
Normal:
https://addons.mozilla.org/firefox/addon/العربية-language-pack/
then I think this piece of code can be removed.
Actually, no.
I checked it again, the backward is on the right side after switching to Arabic language (but they look the same. I said, "left/right relationship of forward/backward is unchanged" because they still look like <- ->
rather than -> <-
:sweat_smile: ).
Change chrome://flags/#force-ui-direction
to RTL in chrome shows the same result (functionality of left right arrows <- ->
will be swapped.).
In the current GD, this piece of code won't be triggered on Linux in anyway.
The whole app level layout direction is never set. No idea what the "auto" means (using LC_ALL=ar
doesn't work and setting the language doesn't work, no idea if it depends on desktop environment's language settings.). https://doc.qt.io/qt-6/qguiapplication.html#layoutDirection-prop
Unrelated, but force setting RTL via qApp->setLayoutDirection(RTL)
looks like this :sweat_smile:
I checked it again, the backward is on the right side after switching to Arabic language (but they look the same. I said, "left/right relationship of forward/backward is unchanged" because they still look like
<- ->
rather than-> <-
😅 ).
the above code will make the button appear as -> <- .(If worked.) which should be controlled by layout direction.
If layout is concerned,all the buttons should be rearranged (through layout direction etc, or toolbar->layout->direction). Only change the Forward/Backward Button is not enough.
Based on above ,the code is still nonsense.
Unrelated, but force setting RTL via
qApp->setLayoutDirection(RTL)
looks like this 😅
what about qApp->setLayoutDirection(Auto) and then change the interface language to arabic/persian
Based on above ,the code is still nonsense.
The code is needed when it triggers because buttons will be added from right to left if the whole app is RTL layout as shown in the forced layout screenshot https://github.com/xiaoyifang/goldendict-ng/issues/1632#issuecomment-2208110215 . Don't remove it.
However, I don't find a way to trigger the whole application RTL layout.
what about qApp->setLayoutDirection(Auto) and then change the interface language to arabic/persian
On Linux, the layout doesn't change to RTL (which is what browsers do) like Qt's doc says.
The code is needed when it triggers because buttons will be added from right to left if the whole app is RTL layout as shown in the forced layout screenshot #1632 (comment) . Don't remove it.
got your idea
the screen seems mirrored. I have a little doubt that ,the Forward/Back button will be mirrored too.(which do not need to set the image explictly).
Can someone share me a screenshot of Arabic(or any RTL language) browser ui interface ,like chrome or firefox?
I want to check the layout of Forward/Back button in the browser.