1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-25 05:52:50 -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

@@ -5,6 +5,9 @@ import qs.Widgets
Rectangle {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property string iconName: ""
property string text: ""
property string secondaryText: ""
@@ -80,6 +83,7 @@ Rectangle {
color: isActive ? Theme.primaryText : Theme.surfaceText
elide: Text.ElideRight
wrapMode: Text.NoWrap
horizontalAlignment: Text.AlignLeft
}
Typography {
@@ -90,6 +94,7 @@ Rectangle {
visible: text.length > 0
elide: Text.ElideRight
wrapMode: Text.NoWrap
horizontalAlignment: Text.AlignLeft
}
}
}

View File

@@ -6,6 +6,9 @@ import qs.Widgets
Row {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property var availableWidgets: []
property Item popoutContent: null
@@ -103,6 +106,7 @@ Row {
color: Theme.surfaceText
elide: Text.ElideRight
width: parent.width
horizontalAlignment: Text.AlignLeft
}
Typography {
@@ -111,6 +115,7 @@ Row {
color: Theme.outline
elide: Text.ElideRight
width: parent.width
horizontalAlignment: Text.AlignLeft
}
}

View File

@@ -6,6 +6,9 @@ import qs.Widgets
Rectangle {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property bool editMode: false
signal powerButtonClicked

View File

@@ -5,6 +5,9 @@ import qs.Widgets
Rectangle {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property string iconName: ""
property string text: ""

View File

@@ -8,6 +8,9 @@ import qs.Widgets
Rectangle {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property bool hasInputVolumeSliderInCC: {
const widgets = SettingsData.controlCenterWidgets || [];
return widgets.some(widget => widget.id === "inputVolumeSlider");
@@ -198,6 +201,7 @@ Rectangle {
elide: Text.ElideRight
width: parent.width
wrapMode: Text.NoWrap
horizontalAlignment: Text.AlignLeft
}
StyledText {
@@ -207,6 +211,7 @@ Rectangle {
elide: Text.ElideRight
width: parent.width
wrapMode: Text.NoWrap
horizontalAlignment: Text.AlignLeft
}
}
}

View File

@@ -8,6 +8,9 @@ import qs.Widgets
Rectangle {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property bool hasVolumeSliderInCC: {
const widgets = SettingsData.controlCenterWidgets || [];
return widgets.some(widget => widget.id === "volumeSlider");
@@ -210,6 +213,7 @@ Rectangle {
elide: Text.ElideRight
width: parent.width
wrapMode: Text.NoWrap
horizontalAlignment: Text.AlignLeft
}
StyledText {
@@ -219,6 +223,7 @@ Rectangle {
elide: Text.ElideRight
width: parent.width
wrapMode: Text.NoWrap
horizontalAlignment: Text.AlignLeft
}
}
}

View File

@@ -5,6 +5,11 @@ import qs.Services
import qs.Widgets
Rectangle {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
implicitHeight: contentColumn.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
@@ -110,6 +115,7 @@ Rectangle {
visible: text.length > 0
elide: Text.ElideRight
width: parent.width
horizontalAlignment: Text.AlignLeft
}
}
}
@@ -249,6 +255,7 @@ Rectangle {
color: Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.8)
wrapMode: Text.WordWrap
width: parent.width
horizontalAlignment: Text.AlignLeft
}
}
}

View File

@@ -6,6 +6,9 @@ import qs.Widgets
Item {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property var device: null
property bool modalVisible: false
property var parentItem

View File

@@ -10,6 +10,9 @@ import qs.Modals
Rectangle {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
implicitHeight: {
if (height > 0) {
return height
@@ -237,6 +240,7 @@ Rectangle {
font.weight: modelData.connected ? Font.Medium : Font.Normal
elide: Text.ElideRight
width: parent.width
horizontalAlignment: Text.AlignLeft
}
Row {
@@ -463,6 +467,7 @@ Rectangle {
color: Theme.surfaceText
elide: Text.ElideRight
width: parent.width
horizontalAlignment: Text.AlignLeft
}
Row {

View File

@@ -7,6 +7,9 @@ import qs.Widgets
Rectangle {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property string initialDeviceName: ""
property string instanceId: ""
property string screenName: ""
@@ -303,6 +306,7 @@ Rectangle {
font.weight: modelData.name === currentDeviceName ? Font.Medium : Font.Normal
elide: Text.ElideRight
width: parent.width
horizontalAlignment: Text.AlignLeft
}
StyledText {
@@ -311,6 +315,7 @@ Rectangle {
color: Theme.surfaceVariantText
elide: Text.ElideRight
width: parent.width
horizontalAlignment: Text.AlignLeft
}
StyledText {
@@ -328,6 +333,7 @@ Rectangle {
color: Theme.surfaceVariantText
elide: Text.ElideRight
width: parent.width
horizontalAlignment: Text.AlignLeft
}
}
}

View File

@@ -6,6 +6,9 @@ import qs.Widgets
Rectangle {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property string currentMountPath: "/"
property string instanceId: ""
@@ -128,6 +131,7 @@ Rectangle {
font.weight: modelData.mount === currentMountPath ? Font.Medium : Font.Normal
elide: Text.ElideRight
width: parent.width
horizontalAlignment: Text.AlignLeft
}
StyledText {
@@ -137,6 +141,7 @@ Rectangle {
elide: Text.ElideRight
width: parent.width
visible: modelData.mount !== "/"
horizontalAlignment: Text.AlignLeft
}
StyledText {
@@ -145,6 +150,7 @@ Rectangle {
color: Theme.surfaceVariantText
elide: Text.ElideRight
width: parent.width
horizontalAlignment: Text.AlignLeft
}
}
}

View File

@@ -9,6 +9,9 @@ import qs.Modals
Rectangle {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
implicitHeight: {
if (height > 0) {
return height;

View File

@@ -6,6 +6,9 @@ import qs.Widgets
Row {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property var defaultSink: AudioService.sink
property color sliderTrackColor: "transparent"

View File

@@ -6,6 +6,9 @@ import qs.Widgets
Row {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property string deviceName: ""
property string instanceId: ""
property string screenName: ""

View File

@@ -1,12 +1,13 @@
import QtQuick
import QtQuick.Controls
import Quickshell
import qs.Common
import qs.Widgets
Rectangle {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property string iconName: ""
property color iconColor: Theme.surfaceText
property string labelText: ""

View File

@@ -5,6 +5,9 @@ import qs.Widgets
Rectangle {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property string iconName: ""
property color iconColor: Theme.surfaceText
property string primaryText: ""
@@ -137,6 +140,7 @@ Rectangle {
font.weight: Font.Medium
elide: Text.ElideRight
wrapMode: Text.NoWrap
horizontalAlignment: Text.AlignLeft
}
StyledText {
width: parent.width
@@ -146,6 +150,7 @@ Rectangle {
visible: text.length > 0
elide: Text.ElideRight
wrapMode: Text.NoWrap
horizontalAlignment: Text.AlignLeft
}
}

View File

@@ -1,8 +1,4 @@
import QtQuick
import QtQuick.Controls
import Quickshell
import qs.Common
import qs.Widgets
Rectangle {
id: root
@@ -24,6 +20,4 @@ Rectangle {
sourceComponent: root.content
asynchronous: true
}
}

View File

@@ -5,6 +5,9 @@ import qs.Widgets
StyledRect {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property string primaryMessage: ""
property string secondaryMessage: ""
@@ -37,6 +40,7 @@ StyledRect {
color: Theme.warning
font.weight: Font.Medium
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignLeft
}
StyledText {
@@ -45,6 +49,7 @@ StyledRect {
font.pixelSize: Theme.fontSizeSmall
color: Theme.warning
visible: text.length > 0
horizontalAlignment: Text.AlignLeft
}
}
}

View File

@@ -6,6 +6,9 @@ import qs.Widgets
Row {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property var defaultSource: AudioService.source
property color sliderTrackColor: "transparent"

View File

@@ -6,6 +6,9 @@ import qs.Widgets
Rectangle {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property bool isActive: BatteryService.batteryAvailable && (BatteryService.isCharging || BatteryService.isPluggedIn)
property bool enabled: BatteryService.batteryAvailable

View File

@@ -6,6 +6,9 @@ import qs.Widgets
Rectangle {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property string mountPath: "/"
property string instanceId: ""
@@ -84,6 +87,7 @@ Rectangle {
color: Theme.surfaceVariantText
elide: Text.ElideMiddle
width: Math.min(implicitWidth, root.width - Theme.iconSizeSmall - Theme.spacingM)
horizontalAlignment: Text.AlignLeft
}
StyledText {

View File

@@ -5,6 +5,9 @@ import qs.Widgets
Rectangle {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property string iconName: ""
property string text: ""
property bool isActive: false
@@ -90,6 +93,7 @@ Rectangle {
font.weight: Font.Medium
elide: Text.ElideRight
wrapMode: Text.NoWrap
horizontalAlignment: Text.AlignLeft
}
StyledText {
@@ -100,6 +104,7 @@ Rectangle {
visible: text.length > 0
elide: Text.ElideRight
wrapMode: Text.NoWrap
horizontalAlignment: Text.AlignLeft
}
}
}

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
}
}
}

View File

@@ -10,6 +10,9 @@ import qs.Modules.Settings.Widgets
Item {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property var parentModal: null
property string selectedMonitorName: {
var screens = Quickshell.screens;
@@ -233,6 +236,7 @@ Item {
elide: Text.ElideMiddle
maximumLineCount: 1
width: parent.width
horizontalAlignment: Text.AlignLeft
}
StyledText {
@@ -245,6 +249,7 @@ Item {
elide: Text.ElideMiddle
maximumLineCount: 1
width: parent.width
horizontalAlignment: Text.AlignLeft
visible: {
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath;
return currentWallpaper !== "";
@@ -252,7 +257,9 @@ Item {
}
Row {
anchors.left: parent.left
spacing: Theme.spacingS
layoutDirection: I18n.isRtl ? Qt.RightToLeft : Qt.LeftToRight
visible: {
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath;
return currentWallpaper !== "";

View File

@@ -93,7 +93,7 @@ Item {
elide: Text.ElideRight
width: parent.width
visible: root.text !== ""
anchors.left: parent.left
horizontalAlignment: Text.AlignLeft
}
StyledText {
@@ -103,7 +103,7 @@ Item {
wrapMode: Text.WordWrap
width: parent.width
visible: root.description !== ""
anchors.left: parent.left
horizontalAlignment: Text.AlignLeft
}
}

View File

@@ -8,6 +8,9 @@ import qs.Widgets
DankDropdown {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property string tab: ""
property var tags: []
property string settingKey: ""

View File

@@ -7,6 +7,9 @@ import qs.Widgets
StyledRect {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property string tab: ""
property var tags: []
@@ -67,6 +70,7 @@ StyledRect {
color: Theme.surfaceVariantText
wrapMode: Text.WordWrap
width: parent.width
horizontalAlignment: Text.AlignLeft
visible: root.description !== ""
}
}

View File

@@ -96,7 +96,7 @@ Item {
color: Theme.surfaceText
visible: root.text !== ""
width: parent.width
anchors.left: parent.left
horizontalAlignment: Text.AlignLeft
}
StyledText {
@@ -106,7 +106,7 @@ Item {
wrapMode: Text.WordWrap
width: parent.width
visible: root.description !== ""
anchors.left: parent.left
horizontalAlignment: Text.AlignLeft
}
}

View File

@@ -7,6 +7,9 @@ import qs.Widgets
StyledRect {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property string tab: ""
property var tags: []
@@ -76,6 +79,7 @@ StyledRect {
color: Theme.surfaceVariantText
wrapMode: Text.WordWrap
width: parent.width
horizontalAlignment: Text.AlignLeft
visible: root.description !== ""
}
}

View File

@@ -8,6 +8,9 @@ import qs.Widgets
DankToggle {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property string tab: ""
property var tags: []
property string settingKey: ""