Skip to content

Commit 8f5bc59

Browse files
committed
Simplify RTL detection
We can use the locale to determine the layout direction, this avoids the ugly QT_LAYOUT_DIRECTION translation.
1 parent 1868300 commit 8f5bc59

File tree

26 files changed

+5
-177
lines changed

26 files changed

+5
-177
lines changed

components/2.0/ComboBox.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ FocusScope {
4646
id: defaultRowDelegate
4747
Text {
4848
anchors.fill: parent
49-
anchors.margins: 4 + (Qt.application.layoutDirection == Qt.RightToLeft ? arrow.width : 0)
49+
anchors.margins: 4 + (LayoutMirroring.enabled ? arrow.width : 0)
5050
verticalAlignment: Text.AlignVCenter
5151
font: container.font
5252

data/themes/circles/Main.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Rectangle {
3030
width: 640
3131
height: 480
3232

33-
LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
33+
LayoutMirroring.enabled: Qt.locale().textDirection == Qt.RightToLeft
3434
LayoutMirroring.childrenInherit: true
3535

3636
TextConstants { id: textConstants }

data/themes/elarun/Main.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Rectangle {
3030
width: 640
3131
height: 480
3232

33-
LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
33+
LayoutMirroring.enabled: Qt.locale().textDirection == Qt.RightToLeft
3434
LayoutMirroring.childrenInherit: true
3535

3636
TextConstants { id: textConstants }

data/themes/maldives/Main.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Rectangle {
3030
width: 640
3131
height: 480
3232

33-
LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
33+
LayoutMirroring.enabled: Qt.locale().textDirection == Qt.RightToLeft
3434
LayoutMirroring.childrenInherit: true
3535

3636
TextConstants { id: textConstants }

data/themes/maui/Main.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Rectangle {
3131
width: 1024
3232
height: 768
3333

34-
LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
34+
LayoutMirroring.enabled: Qt.locale().textDirection == Qt.RightToLeft
3535
LayoutMirroring.childrenInherit: true
3636

3737
property int sessionIndex: session.index

data/translations/ar.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!DOCTYPE TS>
33
<TS version="2.1" language="ar">
4-
<context>
5-
<name>QGuiApplication</name>
6-
<message>
7-
<source>QT_LAYOUT_DIRECTION</source>
8-
<comment>Translate this string to the string &apos;LTR&apos; in left-to-right languages or to &apos;RTL&apos; in right-to-left languages (such as Hebrew and Arabic) to get proper layout direction in SDDM themes that supports it</comment>
9-
<translation>RTL</translation>
10-
</message>
11-
</context>
124
<context>
135
<name>TextConstants</name>
146
<message>

data/translations/cs.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!DOCTYPE TS>
33
<TS version="2.1" language="cs">
4-
<context>
5-
<name>QGuiApplication</name>
6-
<message>
7-
<source>QT_LAYOUT_DIRECTION</source>
8-
<comment>Translate this string to the string &apos;LTR&apos; in left-to-right languages or to &apos;RTL&apos; in right-to-left languages (such as Hebrew and Arabic) to get proper layout direction in SDDM themes that supports it</comment>
9-
<translation type="unfinished"></translation>
10-
</message>
11-
</context>
124
<context>
135
<name>TextConstants</name>
146
<message>

data/translations/de.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!DOCTYPE TS>
33
<TS version="2.1" language="de">
4-
<context>
5-
<name>QGuiApplication</name>
6-
<message>
7-
<source>QT_LAYOUT_DIRECTION</source>
8-
<comment>Translate this string to the string &apos;LTR&apos; in left-to-right languages or to &apos;RTL&apos; in right-to-left languages (such as Hebrew and Arabic) to get proper layout direction in SDDM themes that supports it</comment>
9-
<translation type="unfinished"></translation>
10-
</message>
11-
</context>
124
<context>
135
<name>TextConstants</name>
146
<message>

data/translations/es.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!DOCTYPE TS>
33
<TS version="2.1" language="es">
4-
<context>
5-
<name>QGuiApplication</name>
6-
<message>
7-
<source>QT_LAYOUT_DIRECTION</source>
8-
<comment>Translate this string to the string &apos;LTR&apos; in left-to-right languages or to &apos;RTL&apos; in right-to-left languages (such as Hebrew and Arabic) to get proper layout direction in SDDM themes that supports it</comment>
9-
<translation type="unfinished"></translation>
10-
</message>
11-
</context>
124
<context>
135
<name>TextConstants</name>
146
<message>

data/translations/et.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!DOCTYPE TS>
33
<TS version="2.1" language="et">
4-
<context>
5-
<name>QGuiApplication</name>
6-
<message>
7-
<source>QT_LAYOUT_DIRECTION</source>
8-
<comment>Translate this string to the string &apos;LTR&apos; in left-to-right languages or to &apos;RTL&apos; in right-to-left languages (such as Hebrew and Arabic) to get proper layout direction in SDDM themes that supports it</comment>
9-
<translation type="unfinished"></translation>
10-
</message>
11-
</context>
124
<context>
135
<name>TextConstants</name>
146
<message>

0 commit comments

Comments
 (0)