From 5194b36177fb4e372c520435b505802a3d1a5371 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 29 Mar 2017 19:12:15 +0200 Subject: Added Icon theme --- components/mail/contents/ui/Mail.qml | 7 ++--- components/package/contents/ui/FolderListView.qml | 6 ++--- components/theme/contents/ui/Icons.qml | 31 +++++++++++++++++++++++ components/theme/qmldir | 1 + 4 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 components/theme/contents/ui/Icons.qml diff --git a/components/mail/contents/ui/Mail.qml b/components/mail/contents/ui/Mail.qml index 0643287f..1bdbc5ed 100644 --- a/components/mail/contents/ui/Mail.qml +++ b/components/mail/contents/ui/Mail.qml @@ -31,6 +31,7 @@ import org.kube.framework.notifications 1.0 as KubeNotifications import org.kube.framework.accounts 1.0 as KubeAccountsFramework import org.kube.components 1.0 as KubeComponents import org.kube.components.accounts 1.0 as KubeAccounts +import org.kube.components.theme 1.0 as KubeTheme Controls2.ApplicationWindow { id: app @@ -298,15 +299,15 @@ Controls2.ApplicationWindow { states: [ State { name: "busy"; when: model.status == KubeAccountsFramework.AccountsModel.BusyStatus - PropertyChanges { target: statusIcon; iconName: "view-refresh"; visible: true } + PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.busy; visible: true } }, State { name: "error"; when: model.status == KubeAccountsFramework.AccountsModel.ErrorStatus - PropertyChanges { target: statusIcon; iconName: "emblem-error"; visible: true } + PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.error; visible: true } }, State { name: "checkmark"; when: model.status == KubeAccountsFramework.AccountsModel.ConnectedStatus - PropertyChanges { target: statusIcon; iconName: "checkmark"; visible: true } + PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.connected; visible: true } } ] } diff --git a/components/package/contents/ui/FolderListView.qml b/components/package/contents/ui/FolderListView.qml index 1a2f055c..c0b9c222 100644 --- a/components/package/contents/ui/FolderListView.qml +++ b/components/package/contents/ui/FolderListView.qml @@ -171,17 +171,17 @@ Rectangle { states: [ State { name: "busy"; when: model.status == KubeFramework.FolderListModel.InProgressStatus - PropertyChanges { target: statusIcon; iconName: "view-refresh"; visible: styleData.selected } + PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.busy ; 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 } + PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.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 } + PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.success; visible: styleData.selected } } ] } diff --git a/components/theme/contents/ui/Icons.qml b/components/theme/contents/ui/Icons.qml new file mode 100644 index 00000000..417a598c --- /dev/null +++ b/components/theme/contents/ui/Icons.qml @@ -0,0 +1,31 @@ +/* + Copyright (C) 2017 Michael Bohlender, + Copyright (C) 2017 Christian Mollekopf, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +pragma Singleton + +import QtQuick 2.7 + +Item { + property string error: "error" + property string busy: "view-refresh" + property string noNetworkConnection: "network-disconnect" + property string connected: "checkmark" + property string success: "checkmark" +} + diff --git a/components/theme/qmldir b/components/theme/qmldir index 29cb06d9..6d11dd64 100644 --- a/components/theme/qmldir +++ b/components/theme/qmldir @@ -1,3 +1,4 @@ module org.kube.components.theme singleton Colors 1.0 Colors.qml +singleton Icons 1.0 Icons.qml -- cgit v1.2.3