1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-26 14:32:52 -05:00

i18n: WIP initial RTL support

- notifications
- color picker
- process list
- settings
- control center, dash
- launcher

part of #1059
This commit is contained in:
bbedward
2025-12-17 13:50:06 -05:00
parent 811e89fcfa
commit 523ccc6bf8
41 changed files with 5735 additions and 730 deletions

View File

@@ -95,6 +95,9 @@ DankPopout {
Rectangle {
id: launcherPanel
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property alias searchField: searchField
color: "transparent"
@@ -179,8 +182,8 @@ DankPopout {
mappings[Qt.Key_Backtab] = () => appDrawerPopout.searchMode === "apps" && appLauncher.viewMode === "grid" ? appLauncher.selectPreviousInRow() : keyHandler.selectPrevious();
if (appDrawerPopout.searchMode === "apps" && appLauncher.viewMode === "grid") {
mappings[Qt.Key_Right] = () => appLauncher.selectNextInRow();
mappings[Qt.Key_Left] = () => appLauncher.selectPreviousInRow();
mappings[Qt.Key_Right] = () => I18n.isRtl ? appLauncher.selectPreviousInRow() : appLauncher.selectNextInRow();
mappings[Qt.Key_Left] = () => I18n.isRtl ? appLauncher.selectNextInRow() : appLauncher.selectPreviousInRow();
}
return mappings;
@@ -211,13 +214,13 @@ DankPopout {
return;
case Qt.Key_L:
if (appDrawerPopout.searchMode === "apps" && appLauncher.viewMode === "grid") {
appLauncher.selectNextInRow();
I18n.isRtl ? appLauncher.selectPreviousInRow() : appLauncher.selectNextInRow();
event.accepted = true;
}
return;
case Qt.Key_H:
if (appDrawerPopout.searchMode === "apps" && appLauncher.viewMode === "grid") {
appLauncher.selectPreviousInRow();
I18n.isRtl ? appLauncher.selectNextInRow() : appLauncher.selectPreviousInRow();
event.accepted = true;
}
return;

View File

@@ -110,6 +110,9 @@ DankPopout {
Rectangle {
id: controlContent
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
implicitHeight: mainColumn.implicitHeight + Theme.spacingM
property alias bluetoothCodecSelector: bluetoothCodecSelector

View File

@@ -43,6 +43,9 @@ DankPopout {
Rectangle {
id: batteryContent
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
implicitHeight: contentColumn.implicitHeight + Theme.spacingL * 2
color: "transparent"
radius: Theme.cornerRadius

View File

@@ -166,6 +166,9 @@ DankPopout {
Rectangle {
id: mainContainer
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
implicitHeight: contentColumn.height + Theme.spacingM * 2
color: "transparent"
radius: Theme.cornerRadius

View File

@@ -8,6 +8,9 @@ import qs.Widgets
Item {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property int dropdownType: 0
property var activePlayer: null
property var allPlayers: []

View File

@@ -10,6 +10,9 @@ import qs.Widgets
Item {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property MprisPlayer activePlayer: MprisController.activePlayer
property var allPlayers: MprisController.availablePlayers
property var targetScreen: null

View File

@@ -1,10 +1,12 @@
import QtQuick
import QtQuick.Controls
import qs.Common
Rectangle {
id: card
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property int pad: Theme.spacingM
radius: Theme.cornerRadius

View File

@@ -1,20 +1,19 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import qs.Common
import qs.Services
import qs.Widgets
import qs.Modules.DankDash.Overview
Item {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
implicitWidth: 700
implicitHeight: 410
signal switchToWeatherTab()
signal switchToMediaTab()
signal closeDash()
signal switchToWeatherTab
signal switchToMediaTab
signal closeDash
Item {
anchors.fill: parent

View File

@@ -3,7 +3,6 @@ import QtCore
import QtQuick
import QtQuick.Controls
import QtQuick.Effects
import Quickshell
import qs.Common
import qs.Modals.FileBrowser
import qs.Widgets
@@ -11,6 +10,9 @@ import qs.Widgets
Item {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
implicitWidth: 700
implicitHeight: 410
@@ -95,22 +97,41 @@ Item {
}
if (event.key === Qt.Key_Right || event.key === Qt.Key_L) {
if (gridIndex + 1 < visibleCount) {
gridIndex++;
} else if (currentPage < totalPages - 1) {
gridIndex = 0;
currentPage++;
if (I18n.isRtl) {
if (gridIndex > 0) {
gridIndex--;
} else if (currentPage > 0) {
currentPage--;
const prevPageCount = Math.min(itemsPerPage, wallpaperFolderModel.count - currentPage * itemsPerPage);
gridIndex = prevPageCount - 1;
}
} else {
if (gridIndex + 1 < visibleCount) {
gridIndex++;
} else if (currentPage < totalPages - 1) {
gridIndex = 0;
currentPage++;
}
}
return true;
}
if (event.key === Qt.Key_Left || event.key === Qt.Key_H) {
if (gridIndex > 0) {
gridIndex--;
} else if (currentPage > 0) {
currentPage--;
const prevPageCount = Math.min(itemsPerPage, wallpaperFolderModel.count - currentPage * itemsPerPage);
gridIndex = prevPageCount - 1;
if (I18n.isRtl) {
if (gridIndex + 1 < visibleCount) {
gridIndex++;
} else if (currentPage < totalPages - 1) {
gridIndex = 0;
currentPage++;
}
} else {
if (gridIndex > 0) {
gridIndex--;
} else if (currentPage > 0) {
currentPage--;
const prevPageCount = Math.min(itemsPerPage, wallpaperFolderModel.count - currentPage * itemsPerPage);
gridIndex = prevPageCount - 1;
}
}
return true;
}

View File

@@ -9,6 +9,9 @@ import qs.Modules.DankBar.Widgets
Item {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
implicitWidth: 700
implicitHeight: 410
property bool syncing: false
@@ -145,6 +148,10 @@ Item {
Item {
id: weatherContainer
LayoutMirroring.enabled: false
LayoutMirroring.childrenInherit: true
width: parent.width
height: weatherColumn.height

View File

@@ -100,6 +100,9 @@ DankPopout {
Rectangle {
id: notificationContent
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property var externalKeyboardController: null
property real cachedHeaderHeight: 32

View File

@@ -343,6 +343,9 @@ PanelWindow {
anchors.margins: Theme.snap(4, win.dpr)
clip: true
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
Item {
id: notificationContent
@@ -428,6 +431,7 @@ PanelWindow {
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Medium
elide: Text.ElideRight
horizontalAlignment: Text.AlignLeft
maximumLineCount: 1
}
@@ -438,6 +442,7 @@ PanelWindow {
font.weight: Font.Medium
width: parent.width
elide: Text.ElideRight
horizontalAlignment: Text.AlignLeft
maximumLineCount: 1
visible: text.length > 0
}
@@ -448,6 +453,7 @@ PanelWindow {
font.pixelSize: Theme.fontSizeSmall
width: parent.width
elide: Text.ElideRight
horizontalAlignment: Text.AlignLeft
maximumLineCount: 2
wrapMode: Text.WordWrap
visible: text.length > 0

View File

@@ -50,6 +50,9 @@ DankPopout {
Rectangle {
id: processListContent
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
radius: Theme.cornerRadius
color: "transparent"
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)

View File

@@ -7,6 +7,9 @@ import qs.Widgets
Item {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property string tab: ""
property var tags: []
property string settingKey: ""
@@ -49,6 +52,7 @@ Item {
elide: Text.ElideRight
width: parent.width
visible: root.text !== ""
anchors.left: parent.left
}
StyledText {
@@ -58,6 +62,7 @@ Item {
wrapMode: Text.WordWrap
width: parent.width
visible: root.description !== ""
anchors.left: parent.left
}
}

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: []

View File

@@ -7,6 +7,9 @@ import qs.Widgets
Item {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property string tab: ""
property var tags: []
property string settingKey: ""
@@ -51,6 +54,8 @@ Item {
font.weight: Font.Medium
color: Theme.surfaceText
visible: root.text !== ""
width: parent.width
anchors.left: parent.left
}
StyledText {
@@ -60,6 +65,7 @@ Item {
wrapMode: Text.WordWrap
width: parent.width
visible: root.description !== ""
anchors.left: parent.left
}
}