diff --git a/discover/qml/ApplicationsListPage.qml b/discover/qml/ApplicationsListPage.qml index 640e843a..3d4d948f 100644 --- a/discover/qml/ApplicationsListPage.qml +++ b/discover/qml/ApplicationsListPage.qml @@ -1,208 +1,208 @@ /* * Copyright (C) 2012 Aleix Pol Gonzalez * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library/Lesser General Public License * version 2, or (at your option) any later version, as published by the * Free Software Foundation * * 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 Library/Lesser 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. */ import QtQuick 2.5 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.1 import QtQuick.Window 2.2 import "navigation.js" as Navigation import org.kde.discover.app 1.0 import org.kde.discover 2.0 import org.kde.kirigami 2.4 as Kirigami DiscoverPage { id: page readonly property var model: appsModel property alias category: appsModel.filteredCategory property alias sortRole: appsModel.sortRole property alias sortOrder: appsModel.sortOrder property alias originFilter: appsModel.originFilter property alias mimeTypeFilter: appsModel.mimeTypeFilter property alias stateFilter: appsModel.stateFilter property alias extending: appsModel.extending property alias search: appsModel.search property alias resourcesUrl: appsModel.resourcesUrl property alias isBusy: appsModel.isBusy property alias allBackends: appsModel.allBackends property alias count: apps.count property alias listHeader: apps.header property alias listHeaderPositioning: apps.headerPositioning - property bool compact: page.width < 500 || !applicationWindow().wideScreen + property bool compact: page.width < 550 || !applicationWindow().wideScreen property bool showRating: true property bool canNavigate: true readonly property alias subcategories: appsModel.subcategories title: category ? category.name : "" signal clearSearch() supportsRefreshing: true onRefreshingChanged: if (refreshing) { appsModel.invalidateFilter() refreshing = false } ActionGroup { id: sortGroup exclusive: true } contextualActions: [ Kirigami.Action { text: i18n("Sort: %1", sortGroup.checkedAction.text) Action { ActionGroup.group: sortGroup text: i18n("Name") onTriggered: { appsModel.sortRole = ResourcesProxyModel.NameRole appsModel.sortOrder = Qt.AscendingOrder } checkable: true checked: appsModel.sortRole == ResourcesProxyModel.NameRole } Action { ActionGroup.group: sortGroup text: i18n("Rating") onTriggered: { appsModel.sortRole = ResourcesProxyModel.SortableRatingRole appsModel.sortOrder = Qt.DescendingOrder } checkable: true checked: appsModel.sortRole == ResourcesProxyModel.SortableRatingRole } Action { ActionGroup.group: sortGroup text: i18n("Size") onTriggered: { appsModel.sortRole = ResourcesProxyModel.SizeRole appsModel.sortOrder = Qt.AscendingOrder } checkable: true checked: appsModel.sortRole == ResourcesProxyModel.SizeRole } Action { ActionGroup.group: sortGroup text: i18n("Release Date") onTriggered: { appsModel.sortRole = ResourcesProxyModel.ReleaseDateRole appsModel.sortOrder = Qt.AscendingOrder } checkable: true checked: appsModel.sortRole == ResourcesProxyModel.ReleaseDateRole } } ] Kirigami.CardsListView { id: apps section.delegate: Label { text: section anchors { right: parent.right } } model: ResourcesProxyModel { id: appsModel sortRole: ResourcesProxyModel.SortableRatingRole sortOrder: Qt.DescendingOrder onBusyChanged: if (isBusy) { apps.currentIndex = -1 } } currentIndex: -1 delegate: ApplicationDelegate { application: model.application compact: page.compact showRating: page.showRating } Label { anchors.centerIn: parent opacity: apps.count == 0 && !appsModel.isBusy ? 0.3 : 0 Behavior on opacity { PropertyAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad; } } text: i18n("Sorry, nothing found...") } BusyIndicator { id: busyIndicator anchors { top: parent.bottom horizontalCenter: parent.horizontalCenter margins: Kirigami.Units.largeSpacing } running: false opacity: 0 states: [ State { name: "running"; when: appsModel.isBusy PropertyChanges { target: busyIndicator; opacity: 1; running: true; } AnchorChanges { target: busyIndicator; anchors.bottom: parent.bottom; anchors.top: undefined; } } ] transitions: [ Transition { from: "" to: "running" SequentialAnimation { PauseAnimation { duration: Kirigami.Units.longDuration * 5; } ParallelAnimation { AnchorAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad; } PropertyAnimation { property: "opacity"; duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad; } } } }, Transition { from: "running" to: "" ParallelAnimation { AnchorAnimation { duration: Kirigami.Units.shortDuration; easing.type: Easing.InOutQuad; } PropertyAnimation { property: "opacity"; duration: Kirigami.Units.shortDuration; easing.type: Easing.InOutQuad; } } } ] Label { id: busyLabel anchors { horizontalCenter: parent.horizontalCenter bottom: parent.top } text: i18n("Still looking...") opacity: 0 states: [ State { name: "running"; when: busyIndicator.opacity === 1; PropertyChanges { target: busyLabel; opacity: 1; } } ] transitions: Transition { from: "" to: "running" SequentialAnimation { PauseAnimation { duration: Kirigami.Units.longDuration * 5; } PropertyAnimation { property: "opacity"; duration: Kirigami.Units.longDuration * 10; easing.type: Easing.InOutCubic; } } } } } } } diff --git a/discover/qml/BrowsingPage.qml b/discover/qml/BrowsingPage.qml index f92cb1b6..154e6da5 100644 --- a/discover/qml/BrowsingPage.qml +++ b/discover/qml/BrowsingPage.qml @@ -1,57 +1,57 @@ /* * Copyright (C) 2015 Aleix Pol Gonzalez * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library/Lesser General Public License * version 2, or (at your option) any later version, as published by the * Free Software Foundation * * 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 Library/Lesser 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. */ import QtQuick 2.4 import QtQuick.Controls 2.1 import QtQuick.Layouts 1.1 import org.kde.discover 2.0 import org.kde.discover.app 1.0 import "navigation.js" as Navigation import org.kde.kirigami 2.4 as Kirigami DiscoverPage { id: page title: i18n("Featured") leftPadding: 0 rightPadding: 0 topPadding: 0 bottomPadding: 0 readonly property bool isHome: true function searchFor(text) { if (text.length === 0) return; Navigation.openCategory(null, "") } signal clearSearch() - readonly property bool compact: page.width < 500 || !applicationWindow().wideScreen + readonly property bool compact: page.width < 550 || !applicationWindow().wideScreen Kirigami.CardsListView { model: FeaturedModel {} currentIndex: -1 delegate: ApplicationDelegate { application: model.application compact: page.compact } } }