From 899d121f548649f855e06fb49776000897cfcf22 Mon Sep 17 00:00:00 2001 From: Naomi Kirby Date: Wed, 18 Dec 2024 14:22:41 -0800 Subject: [PATCH] Add QML states for the new StateOnboarding --- src/commands/commandstatus.cpp | 4 ++++ .../home/controller/ControllerImage.qml | 18 +++++++++++++++++ .../home/controller/ControllerView.qml | 3 ++- src/ui/screens/home/controller/VPNToggle.qml | 20 +++++++++++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/src/commands/commandstatus.cpp b/src/commands/commandstatus.cpp index f53761e4ec..a15d2cb386 100644 --- a/src/commands/commandstatus.cpp +++ b/src/commands/commandstatus.cpp @@ -158,6 +158,10 @@ int CommandStatus::run(QStringList& tokens) { case Controller::StateSwitching: stream << "switching"; break; + + case Controller::State::StateOnboarding: + stream << "onboarding"; + break; } stream << Qt::endl; diff --git a/src/ui/screens/home/controller/ControllerImage.qml b/src/ui/screens/home/controller/ControllerImage.qml index 2e129e3846..30030ee2b9 100644 --- a/src/ui/screens/home/controller/ControllerImage.qml +++ b/src/ui/screens/home/controller/ControllerImage.qml @@ -136,6 +136,24 @@ Rectangle { opacity: 1 } }, + State { + name: VPNController.StateOnboarding + + PropertyChanges { + target: logo + showVPNOnIcon: false + opacity: 0.55 + } + PropertyChanges { + target: insetCircle + color: MZTheme.colors.successAccent + } + PropertyChanges { + target: insetIcon + source: "qrc:/ui/resources/shield-off.svg" + opacity: 1 + } + }, State { name: VPNController.StateOn PropertyChanges { diff --git a/src/ui/screens/home/controller/ControllerView.qml b/src/ui/screens/home/controller/ControllerView.qml index 09cf3e7e83..55c1260f21 100644 --- a/src/ui/screens/home/controller/ControllerView.qml +++ b/src/ui/screens/home/controller/ControllerView.qml @@ -63,7 +63,8 @@ Item { states: [ State { name: "stateInitializing" - when: VPNController.state === VPNController.StateInitializing + when: VPNController.state === VPNController.StateInitializing || + VPNController.state === VPNController.StateOnboarding PropertyChanges { target: boxBackground diff --git a/src/ui/screens/home/controller/VPNToggle.qml b/src/ui/screens/home/controller/VPNToggle.qml index ce8aacc749..12ca7b6107 100644 --- a/src/ui/screens/home/controller/VPNToggle.qml +++ b/src/ui/screens/home/controller/VPNToggle.qml @@ -237,6 +237,26 @@ MZButtonBase { toggleColor: MZTheme.colors.vpnToggleConnected } + }, + State { + name: VPNController.StateOnboarding + + PropertyChanges { + target: cursor + anchors.leftMargin: 4 + } + + PropertyChanges { + target: toggle + color: MZTheme.colors.vpnToggleDisconnected.defaultColor + border.color: MZTheme.colors.bgColorStronger + } + + PropertyChanges { + target: toggleButton + toggleColor: MZTheme.colors.vpnToggleDisconnected + } + } ] transitions: [