summaryrefslogtreecommitdiff
path: root/raveos-calamares-module/desktopselect/ui/desktopselect.qml
diff options
context:
space:
mode:
Diffstat (limited to 'raveos-calamares-module/desktopselect/ui/desktopselect.qml')
-rw-r--r--raveos-calamares-module/desktopselect/ui/desktopselect.qml30
1 files changed, 23 insertions, 7 deletions
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)
}
}