From 99293aec6986cd2a6e6022c5882a8f9de0335621 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 27 Mar 2017 11:50:25 +0200 Subject: Show folder sync status --- components/package/contents/ui/FolderListView.qml | 35 ++++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'components/package') diff --git a/components/package/contents/ui/FolderListView.qml b/components/package/contents/ui/FolderListView.qml index a4d25e02..19fda843 100644 --- a/components/package/contents/ui/FolderListView.qml +++ b/components/package/contents/ui/FolderListView.qml @@ -148,16 +148,43 @@ Rectangle { } } - Text { + Row { anchors { verticalCenter: parent.verticalCenter left: parent.left - leftMargin: Kirigami.Units.smallSpacing } + Text { + anchors { + verticalCenter: parent.verticalCenter + leftMargin: Kirigami.Units.smallSpacing + } - text: styleData.value + text: styleData.value - color: Kirigami.Theme.viewBackgroundColor + color: Kirigami.Theme.viewBackgroundColor + } + ToolButton { + id: statusIcon + visible: false + iconName: "" + enabled: false + states: [ + State { + name: "busy"; when: model.status == KubeFramework.FolderListModel.InProgressStatus + PropertyChanges { target: statusIcon; iconName: "view-refresh"; visible: styleData.selected } + }, + State { + name: "error"; when: model.status == KubeFramework.FolderListModel.ErrorStatus + //The error status should only be visible for a moment, otherwise we'll eventually always show errors everywhere. + PropertyChanges { target: statusIcon; iconName: "emblem-error"; visible: styleData.selected } + }, + State { + name: "checkmark"; when: model.status == KubeFramework.FolderListModel.SuccessStatus + //The success status should only be visible for a moment, otherwise we'll eventually always show checkmarks everywhere. + PropertyChanges { target: statusIcon; iconName: "checkmark"; visible: styleData.selected } + } + ] + } } } -- cgit v1.2.3