From 07c475dd96d16181834816194f20a0b79f763520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Tue, 28 Mar 2023 17:33:33 +0800 Subject: Light/Dark mode buttons start to function --- Header.ui.qml | 60 ++++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 13 deletions(-) (limited to 'Header.ui.qml') diff --git a/Header.ui.qml b/Header.ui.qml index 5001647..85fb1c4 100644 --- a/Header.ui.qml +++ b/Header.ui.qml @@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15 import QtGraphicalEffects 1.15 import Eduport 1.4 import "DropShadow" as DrpShdw +import "Button" as Btn import "Label" as Lbl ToolBar { @@ -17,6 +18,8 @@ ToolBar { property alias accountSettings: accountSettings property alias help: help property alias log: log + property alias light: light + property alias dark: dark background: Rectangle { implicitHeight: 70 @@ -170,26 +173,57 @@ ToolBar { Item { implicitHeight: mode.height + 16 - RowLayout { - id: mode - spacing: 0 + Rectangle { + implicitHeight: mode.height + + 8 + color: Eduport.bsLight + radius: Eduport.bsBorderRadius anchors { left: parent.left - leftMargin: 4 right: parent.right - rightMargin: 4 bottom: parent.bottom - bottomMargin: 4 } - Button { - text: qsTr("Light") - Layout.fillWidth: true - } + RowLayout { + id: mode + spacing: 0 + anchors { + left: parent + .left + leftMargin: 4 + right: parent + .right + rightMargin: 4 + verticalCenter + : parent + .verticalCenter + } - Button { - text: qsTr("Dark") - Layout.fillWidth: true + Btn.Sm { + id: light + text: + qsTr("Light") + Layout + .fillWidth: + true + checked: Eduport + .mode == Eduport + .Mode.Light + enabled: !checked + } + + Btn.Sm { + id: dark + text: + qsTr("Dark") + Layout + .fillWidth: + true + checked: Eduport + .mode == Eduport + .Mode.Dark + enabled: !checked + } } } } -- cgit v1.2.3