Changeset View
Changeset View
Standalone View
Standalone View
discover/qml/UpdatesPage.qml
1 | import QtQuick.Controls 1.2 | 1 | import QtQuick.Controls 1.2 | ||
---|---|---|---|---|---|
2 | import QtQuick.Controls 2.1 as QQC2 | 2 | import QtQuick.Controls 2.1 as QQC2 | ||
3 | import QtQuick.Layouts 1.1 | 3 | import QtQuick.Layouts 1.1 | ||
4 | import QtQuick 2.4 | 4 | import QtQuick 2.4 | ||
5 | import org.kde.discover 2.0 | 5 | import org.kde.discover 2.0 | ||
6 | import org.kde.discover.app 1.0 | 6 | import org.kde.discover.app 1.0 | ||
7 | import org.kde.kquickcontrolsaddons 2.0 | 7 | import org.kde.kquickcontrolsaddons 2.0 | ||
8 | import org.kde.kcoreaddons 1.0 | 8 | import org.kde.kcoreaddons 1.0 | ||
9 | import "navigation.js" as Navigation | 9 | import "navigation.js" as Navigation | ||
10 | import org.kde.kirigami 2.1 as Kirigami | 10 | import org.kde.kirigami 2.2 as Kirigami | ||
11 | 11 | | |||
12 | DiscoverPage | 12 | DiscoverPage | ||
13 | { | 13 | { | ||
14 | id: page | 14 | id: page | ||
15 | title: i18n("Updates") | 15 | title: i18n("Updates") | ||
16 | 16 | | |||
17 | property string footerLabel: "" | 17 | property string footerLabel: "" | ||
18 | 18 | | |||
Show All 38 Lines | |||||
57 | } | 57 | } | ||
58 | 58 | | |||
59 | readonly property int unselected: (updateModel.totalUpdatesCount - updateModel.toUpdateCount) | 59 | readonly property int unselected: (updateModel.totalUpdatesCount - updateModel.toUpdateCount) | ||
60 | readonly property QtObject currentAction: resourcesUpdatesModel.isProgressing ? cancelUpdateAction : updateAction | 60 | readonly property QtObject currentAction: resourcesUpdatesModel.isProgressing ? cancelUpdateAction : updateAction | ||
61 | actions.main: applicationWindow().wideScreen ? null : currentAction | 61 | actions.main: applicationWindow().wideScreen ? null : currentAction | ||
62 | 62 | | |||
63 | header: QQC2.ToolBar { | 63 | header: QQC2.ToolBar { | ||
64 | visible: (updateModel.totalUpdatesCount > 0 && resourcesUpdatesModel.isProgressing) || updateModel.hasUpdates | 64 | visible: (updateModel.totalUpdatesCount > 0 && resourcesUpdatesModel.isProgressing) || updateModel.hasUpdates | ||
65 | height: Kirigami.Units.gridUnit * 2.3 | ||||
66 | Kirigami.Theme.inherit: false | ||||
67 | Kirigami.Theme.colorSet: Kirigami.Theme.Window | ||||
65 | 68 | | |||
66 | RowLayout { | 69 | RowLayout { | ||
67 | anchors.fill: parent | 70 | anchors.fill: parent | ||
68 | LabelBackground { | 71 | LabelBackground { | ||
69 | Layout.leftMargin: Kirigami.Units.gridUnit | 72 | Layout.leftMargin: Kirigami.Units.gridUnit | ||
70 | text: updateModel.toUpdateCount + " (" + updateModel.updateSize+")" | 73 | text: updateModel.toUpdateCount + " (" + updateModel.updateSize+")" | ||
71 | } | 74 | } | ||
72 | QQC2.Label { | 75 | QQC2.Label { | ||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 142 | delegate: Kirigami.Heading { | |||
141 | level: 2 | 144 | level: 2 | ||
142 | text: section | 145 | text: section | ||
143 | } | 146 | } | ||
144 | } | 147 | } | ||
145 | 148 | | |||
146 | spacing: Kirigami.Units.smallSpacing | 149 | spacing: Kirigami.Units.smallSpacing | ||
147 | 150 | | |||
148 | delegate: Kirigami.AbstractListItem { | 151 | delegate: Kirigami.AbstractListItem { | ||
149 | backgroundColor: Kirigami.Theme.viewBackgroundColor | 152 | backgroundColor: Kirigami.Theme.backgroundColor | ||
150 | x: Kirigami.Units.gridUnit | 153 | x: Kirigami.Units.gridUnit | ||
151 | width: ListView.view.width - Kirigami.Units.gridUnit * 2 | 154 | width: ListView.view.width - Kirigami.Units.gridUnit * 2 | ||
152 | highlighted: ListView.isCurrentItem | 155 | highlighted: ListView.isCurrentItem | ||
153 | onEnabledChanged: if (!enabled) { | 156 | onEnabledChanged: if (!enabled) { | ||
154 | layout.extended = false; | 157 | layout.extended = false; | ||
155 | } | 158 | } | ||
156 | 159 | | |||
157 | Keys.onReturnPressed: { | 160 | Keys.onReturnPressed: { | ||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |