1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

i18n: more RTL layout enhancements

This commit is contained in:
bbedward
2026-01-08 16:11:30 -05:00
parent a21a846bf5
commit 1ff1f3a7f2
53 changed files with 1605 additions and 774 deletions

View File

@@ -6,6 +6,9 @@ import qs.Widgets
Card {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
Component.onCompleted: DgopService.addRef("system")
Component.onDestruction: DgopService.removeRef("system")
@@ -44,9 +47,11 @@ Card {
color: Theme.surfaceText
elide: Text.ElideRight
width: parent.parent.parent.width - avatarContainer.width - Theme.spacingM * 3
horizontalAlignment: Text.AlignLeft
}
Row {
anchors.left: parent.left
spacing: Theme.spacingS
SystemLogo {
@@ -76,10 +81,12 @@ Card {
anchors.verticalCenter: parent.verticalCenter
elide: Text.ElideRight
width: parent.parent.parent.parent.width - avatarContainer.width - Theme.spacingM * 3 - 16 - Theme.spacingS
horizontalAlignment: Text.AlignLeft
}
}
Row {
anchors.left: parent.left
spacing: Theme.spacingS
DankIcon {

View File

@@ -1,6 +1,5 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Effects
import qs.Common
import qs.Services
import qs.Widgets
@@ -8,7 +7,10 @@ import qs.Widgets
Card {
id: root
signal clicked()
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
signal clicked
Component.onCompleted: WeatherService.addRef()
Component.onDestruction: WeatherService.removeRef()
@@ -60,10 +62,12 @@ Card {
anchors.verticalCenter: parent.verticalCenter
StyledText {
anchors.left: parent.left
text: {
const temp = SettingsData.useFahrenheit ? WeatherService.weather.tempF : WeatherService.weather.temp
if (temp === undefined || temp === null) return "--°" + (SettingsData.useFahrenheit ? "F" : "C")
return temp + "°" + (SettingsData.useFahrenheit ? "F" : "C")
const temp = SettingsData.useFahrenheit ? WeatherService.weather.tempF : WeatherService.weather.temp;
if (temp === undefined || temp === null)
return "--°" + (SettingsData.useFahrenheit ? "F" : "C");
return temp + "°" + (SettingsData.useFahrenheit ? "F" : "C");
}
font.pixelSize: Theme.fontSizeXLarge + 4
color: Theme.surfaceText
@@ -76,6 +80,7 @@ Card {
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.7)
elide: Text.ElideRight
width: parent.parent.parent.width - 48 - Theme.spacingL * 2
horizontalAlignment: Text.AlignLeft
}
}
}