Skip to content

Commit

Permalink
Add QML states for the new StateOnboarding
Browse files Browse the repository at this point in the history
  • Loading branch information
oskirby committed Dec 18, 2024
1 parent f8836b7 commit 899d121
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/commands/commandstatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
18 changes: 18 additions & 0 deletions src/ui/screens/home/controller/ControllerImage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion src/ui/screens/home/controller/ControllerView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions src/ui/screens/home/controller/VPNToggle.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down

0 comments on commit 899d121

Please sign in to comment.