Changeset View
Changeset View
Standalone View
Standalone View
discover/qml/BrowsingPage.qml
Show All 12 Lines | |||||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Library/Lesser General Public | 14 | * You should have received a copy of the GNU Library/Lesser General Public | ||
15 | * License along with this program; if not, write to the | 15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | 16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.4 | 20 | import QtQuick 2.4 | ||
21 | import QtQuick.Controls 2.1 | 21 | import QtQuick.Controls 2.4 | ||
22 | import QtQuick.Layouts 1.1 | 22 | import QtQuick.Layouts 1.1 | ||
23 | import org.kde.discover 2.0 | 23 | import org.kde.discover 2.0 | ||
24 | import org.kde.discover.app 1.0 | 24 | import org.kde.discover.app 1.0 | ||
25 | import "navigation.js" as Navigation | 25 | import "navigation.js" as Navigation | ||
26 | import org.kde.kirigami 2.4 as Kirigami | 26 | import org.kde.kirigami 2.12 as Kirigami | ||
27 | 27 | | |||
28 | DiscoverPage | 28 | DiscoverPage | ||
29 | { | 29 | { | ||
30 | id: page | 30 | id: page | ||
31 | title: i18n("Featured") | 31 | title: i18n("Featured") | ||
32 | leftPadding: 0 | 32 | leftPadding: 0 | ||
33 | rightPadding: 0 | 33 | rightPadding: 0 | ||
34 | topPadding: 0 | 34 | topPadding: 0 | ||
Show All 10 Lines | |||||
45 | BusyIndicator { | 45 | BusyIndicator { | ||
46 | id: indicator | 46 | id: indicator | ||
47 | anchors.centerIn: parent | 47 | anchors.centerIn: parent | ||
48 | width: Kirigami.Units.gridUnit * 8 | 48 | width: Kirigami.Units.gridUnit * 8 | ||
49 | height: width | 49 | height: width | ||
50 | visible: apps.count === 0 && apps.model.isFetching | 50 | visible: apps.count === 0 && apps.model.isFetching | ||
51 | } | 51 | } | ||
52 | 52 | | |||
53 | Kirigami.PlaceholderMessage { | ||||
54 | anchors.centerIn: parent | ||||
55 | anchors.left: parent.left | ||||
56 | anchors.right: parent.right | ||||
57 | anchors.margins: Kirigami.Units.largeSpacing | ||||
58 | | ||||
59 | visible: apps.count === 0 && !apps.model.isFetching | ||||
60 | | ||||
61 | icon.name: "network-disconnect" | ||||
62 | text: xi18nc("@info", "Unable to load applications.<nl/>Please verify Internet connectivity.") | ||||
63 | } | ||||
64 | | ||||
53 | background: Rectangle { | 65 | background: Rectangle { | ||
54 | color: Kirigami.Theme.backgroundColor | 66 | color: Kirigami.Theme.backgroundColor | ||
55 | Kirigami.Theme.colorSet: Kirigami.Theme.Window | 67 | Kirigami.Theme.colorSet: Kirigami.Theme.Window | ||
56 | Kirigami.Theme.inherit: false | 68 | Kirigami.Theme.inherit: false | ||
57 | } | 69 | } | ||
58 | 70 | | |||
59 | signal clearSearch() | 71 | signal clearSearch() | ||
60 | 72 | | |||
61 | readonly property bool compact: page.width < 550 || !applicationWindow().wideScreen | 73 | readonly property bool compact: page.width < 550 || !applicationWindow().wideScreen | ||
62 | 74 | | |||
63 | Kirigami.CardsListView { | 75 | Kirigami.CardsListView { | ||
64 | id: apps | 76 | id: apps | ||
65 | model: FeaturedModel {} | 77 | model: FeaturedModel {} | ||
66 | currentIndex: -1 | 78 | currentIndex: -1 | ||
67 | delegate: ApplicationDelegate { | 79 | delegate: ApplicationDelegate { | ||
68 | application: model.application | 80 | application: model.application | ||
69 | compact: page.compact | 81 | compact: page.compact | ||
70 | } | 82 | } | ||
71 | | ||||
72 | footer: ColumnLayout { | | |||
73 | visible: apps.count === 0 && !apps.model.isFetching | | |||
74 | width: parent.width | | |||
75 | | ||||
76 | Kirigami.Icon { | | |||
77 | source: "network-disconnect" | | |||
78 | Layout.alignment: Qt.AlignHCenter | | |||
79 | width: Kirigami.Units.gridUnit * 4 | | |||
80 | height: width | | |||
81 | } | | |||
82 | | ||||
83 | Kirigami.Heading { | | |||
84 | Layout.fillWidth: true | | |||
85 | horizontalAlignment: Text.AlignHCenter | | |||
86 | text: xi18nc("@info", "Unable to load applications.<nl/>Please verify Internet connectivity.") | | |||
87 | level: 3 | | |||
88 | } | | |||
89 | } | | |||
90 | } | 83 | } | ||
91 | } | 84 | } |