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/mail/contents/ui/Mail.qml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'components/mail/contents/ui') diff --git a/components/mail/contents/ui/Mail.qml b/components/mail/contents/ui/Mail.qml index c5078877..0643287f 100644 --- a/components/mail/contents/ui/Mail.qml +++ b/components/mail/contents/ui/Mail.qml @@ -291,9 +291,24 @@ Controls2.ApplicationWindow { } ToolButton { - visible: model.showStatus - iconName: model.statusIcon + id: statusIcon + visible: false + iconName: "" enabled: false + 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 } + } + ] } } } -- cgit v1.2.3