From e777e948e2c4d02f099806c8817a5f783a186ee1 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Tue, 9 Jul 2024 18:04:57 +0200 Subject: [PATCH] native: add color function --- native/Main.qml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/native/Main.qml b/native/Main.qml index dcbe808..b4741a3 100644 --- a/native/Main.qml +++ b/native/Main.qml @@ -7,11 +7,15 @@ Window { SystemPalette { id: inactiveColors; colorGroup: SystemPalette.Inactive } SystemPalette { id: disabledColors; colorGroup: SystemPalette.Disabled } + function getColors() { + return root.active ? activeColors : inactiveColors; + } + id: root width: 640 height: 480 visible: true - color: active ? activeColors.window : inactiveColors.window + color: getColors().window title: qsTr("Alisa - License Managment") @@ -20,11 +24,11 @@ Window { anchors { top: parent.top left: parent.left - right: parent.rightali + right: parent.right } height: 50 border.width: 5 - border.color: root.active ? activeColors.accent : inactiveColors.accent - color: root.active ? activeColors.midlight : inactiveColors.midlight + border.color: getColors().accent + color: getColors().midlight } }