From 5f1cf5b7926c568998f213beba9d7932ef7742ef Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 27 Mar 2017 09:43:37 +0200 Subject: Use states for the account status icon --- components/package/contents/ui/AccountSwitcher.qml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'components/package') diff --git a/components/package/contents/ui/AccountSwitcher.qml b/components/package/contents/ui/AccountSwitcher.qml index 74b6c1ff..8e82dc03 100644 --- a/components/package/contents/ui/AccountSwitcher.qml +++ b/components/package/contents/ui/AccountSwitcher.qml @@ -163,9 +163,24 @@ Controls.ToolButton { } Controls.ToolButton { + id: statusIcon + visible: false + iconName: "" enabled: false - visible: model.showStatus - iconName: model.statusIcon + states: [ + State { + name: "busy"; when: model.status == KubeAccountsFramework.AccountsModel.BusyStatus + PropertyChanges { target: statusIcon; iconName: "view-refresh"; visible: true } + }, + State { + name: "error"; when: model.status == KubeAccountsFramework.AccountsModel.ErrorStatus + PropertyChanges { target: statusIcon; iconName: "emblem-error"; visible: true } + }, + State { + name: "checkmark"; when: model.status == KubeAccountsFramework.AccountsModel.ConnectedStatus + PropertyChanges { target: statusIcon; iconName: "checkmark"; visible: true } + } + ] } } Controls2.Button { -- cgit v1.2.3