diff options
Diffstat (limited to 'raveos-calamares-module/desktopselect/ui')
| -rw-r--r-- | raveos-calamares-module/desktopselect/ui/Translations.qml | 54 | ||||
| -rw-r--r-- | raveos-calamares-module/desktopselect/ui/desktopselect.qml | 30 | ||||
| -rw-r--r-- | raveos-calamares-module/desktopselect/ui/qmldir | 1 |
3 files changed, 78 insertions, 7 deletions
diff --git a/raveos-calamares-module/desktopselect/ui/Translations.qml b/raveos-calamares-module/desktopselect/ui/Translations.qml new file mode 100644 index 0000000..389bf72 --- /dev/null +++ b/raveos-calamares-module/desktopselect/ui/Translations.qml @@ -0,0 +1,54 @@ +pragma Singleton +import QtQuick 2.15 + +/** + * Desktop Selector Modul Fordítások + * ================================== + * + * Támogatott nyelvek: + * - hu_HU: Magyar + * - de_DE: Német + * - en_US, en_GB, stb.: Angol (alapértelmezett) + * + * Használat QML-ben: + * Text { text: Translations.title } + */ + +QtObject { + id: root + + // Aktuális nyelv kód (pl. "hu_HU", "en_US") + property string currentLanguage: "en_US" + + // Modul fő címe + property string title: "Select Desktop" + + // Figyelmeztető banner + property string banner: "Choose a desktop environment. You can only choose one!" + + function setLanguage(locale) { + currentLanguage = locale + + // ================== + // MAGYAR + // ================== + if (locale.startsWith("hu")) { + title = "Desktop kiválasztása" + banner = "Válassz egy desktop környezetet. Csak egyet választhatsz!" + } + // ================== + // NÉMET + // ================== + else if (locale.startsWith("de")) { + title = "Desktop auswählen" + banner = "Wähle eine Desktop-Umgebung. Du kannst nur eine auswählen!" + } + // ================== + // ANGOL (alapértelmezett) + // ================== + else { + title = "Select Desktop" + banner = "Choose a desktop environment. You can only choose one!" + } + } +} diff --git a/raveos-calamares-module/desktopselect/ui/desktopselect.qml b/raveos-calamares-module/desktopselect/ui/desktopselect.qml index 02cb365..077947b 100644 --- a/raveos-calamares-module/desktopselect/ui/desktopselect.qml +++ b/raveos-calamares-module/desktopselect/ui/desktopselect.qml @@ -1,11 +1,22 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15 +import "." as DesktopSelectModule Rectangle { id: root color: "#404040" + // Function to update language - called from C++ + function updateLanguage() { + DesktopSelectModule.Translations.setLanguage(systemLocale) + } + + // Initialize translations on load + Component.onCompleted: { + DesktopSelectModule.Translations.setLanguage(systemLocale) + } + // Nagy külső keret — cím, banner, kártyák mind benne Rectangle { anchors.fill: parent @@ -20,7 +31,7 @@ Rectangle { // Cím Text { - text: "Desktop kiválasztása" + text: DesktopSelectModule.Translations.title font.pixelSize: 24 font.bold: true color: "#ffffff" @@ -37,7 +48,7 @@ Rectangle { Text { anchors.centerIn: parent - text: "Válassz egy desktop környezetet. Csak egyet választhatsz!" + text: DesktopSelectModule.Translations.banner color: "#e0e0e0" font.pixelSize: 13 } @@ -53,11 +64,15 @@ Rectangle { model: backend.desktops delegate: Rectangle { + id: card width: desktopList.width height: 78 radius: 8 - color: backend.selectedIndex === index ? "#2a4a2a" : "#333333" - border.color: backend.selectedIndex === index ? "#5cb85c" : "#555555" + + property bool selectable: modelData.available !== false + + color: !selectable ? "#2a2a2a" : (backend.selectedIndex === index ? "#2a4a2a" : "#333333") + border.color: !selectable ? "#444444" : (backend.selectedIndex === index ? "#5cb85c" : "#555555") border.width: 2 RowLayout { @@ -72,14 +87,14 @@ Rectangle { Text { text: modelData.name || "" - color: "#ffffff" + color: card.selectable ? "#ffffff" : "#9a9a9a" font.pixelSize: 15 font.bold: true } Text { text: modelData.description || "" - color: "#b2b2b2" + color: card.selectable ? "#b2b2b2" : "#8a8a8a" font.pixelSize: 12 width: parent.width elide: Text.ElideRight @@ -105,7 +120,8 @@ Rectangle { MouseArea { anchors.fill: parent - cursorShape: Qt.PointingHandCursor + cursorShape: card.selectable ? Qt.PointingHandCursor : Qt.ArrowCursor + enabled: card.selectable onClicked: backend.selectDesktop(index) } } diff --git a/raveos-calamares-module/desktopselect/ui/qmldir b/raveos-calamares-module/desktopselect/ui/qmldir index 442b282..8968813 100644 --- a/raveos-calamares-module/desktopselect/ui/qmldir +++ b/raveos-calamares-module/desktopselect/ui/qmldir @@ -1 +1,2 @@ module DesktopSelectModule +singleton Translations 1.0 Translations.qml |