Changeset View
Changeset View
Standalone View
Standalone View
discover/qml/UpdatesPage.qml
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | 53 | { | |||
---|---|---|---|---|---|
55 | iconName: "dialog-cancel" | 55 | iconName: "dialog-cancel" | ||
56 | text: i18n("Cancel") | 56 | text: i18n("Cancel") | ||
57 | enabled: resourcesUpdatesModel.transaction && resourcesUpdatesModel.transaction.isCancellable | 57 | enabled: resourcesUpdatesModel.transaction && resourcesUpdatesModel.transaction.isCancellable | ||
58 | onTriggered: resourcesUpdatesModel.transaction.cancel() | 58 | onTriggered: resourcesUpdatesModel.transaction.cancel() | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | readonly property int unselected: (updateModel.totalUpdatesCount - updateModel.toUpdateCount) | 61 | readonly property int unselected: (updateModel.totalUpdatesCount - updateModel.toUpdateCount) | ||
62 | readonly property QtObject currentAction: resourcesUpdatesModel.isProgressing ? cancelUpdateAction : updateAction | 62 | readonly property QtObject currentAction: resourcesUpdatesModel.isProgressing ? cancelUpdateAction : updateAction | ||
63 | actions.main: applicationWindow().wideScreen ? null : currentAction | 63 | actions.main: currentAction | ||
64 | 64 | | |||
65 | header: QQC2.ToolBar { | 65 | header: QQC2.ToolBar { | ||
66 | visible: (updateModel.totalUpdatesCount > 0 && resourcesUpdatesModel.isProgressing) || updateModel.hasUpdates | 66 | visible: (updateModel.totalUpdatesCount > 0 && resourcesUpdatesModel.isProgressing) || updateModel.hasUpdates | ||
67 | 67 | | |||
68 | RowLayout { | 68 | RowLayout { | ||
69 | anchors.fill: parent | 69 | anchors.horizontalCenter: parent.horizontalCenter | ||
apol: Why move to the center? | |||||
70 | anchors.verticalCenter: parent.verticalCenter | ||||
70 | LabelBackground { | 71 | LabelBackground { | ||
71 | Layout.leftMargin: Kirigami.Units.gridUnit | 72 | Layout.leftMargin: Kirigami.Units.gridUnit | ||
72 | text: updateModel.toUpdateCount + " (" + updateModel.updateSize+")" | 73 | text: updateModel.toUpdateCount + " (" + updateModel.updateSize+")" | ||
73 | } | 74 | } | ||
74 | QQC2.Label { | 75 | QQC2.Label { | ||
75 | text: i18n("updates selected") | 76 | text: i18n("updates selected") | ||
76 | } | 77 | } | ||
77 | LabelBackground { | 78 | LabelBackground { | ||
78 | id: unselectedItem | 79 | id: unselectedItem | ||
79 | text: page.unselected | 80 | text: page.unselected | ||
80 | visible: page.unselected>0 | 81 | visible: page.unselected>0 | ||
81 | } | 82 | } | ||
82 | QQC2.Label { | 83 | QQC2.Label { | ||
83 | text: i18n("updates not selected") | 84 | text: i18n("updates not selected") | ||
84 | visible: unselectedItem.visible | 85 | visible: unselectedItem.visible | ||
85 | } | 86 | } | ||
86 | | ||||
87 | Item { | | |||
88 | Layout.fillWidth: true | | |||
89 | } | | |||
90 | | ||||
91 | Button { | | |||
92 | Layout.minimumWidth: Kirigami.Units.gridUnit * 6 | | |||
93 | Layout.rightMargin: Kirigami.Units.gridUnit | | |||
94 | text: page.currentAction.text | | |||
95 | visible: !page.actions.main | | |||
96 | onClicked: page.currentAction.trigger() | | |||
97 | } | | |||
98 | } | 87 | } | ||
99 | } | 88 | } | ||
100 | 89 | | |||
101 | supportsRefreshing: true | 90 | supportsRefreshing: true | ||
102 | onRefreshingChanged: { | 91 | onRefreshingChanged: { | ||
103 | showPassiveNotification("Fetching updates...") | 92 | showPassiveNotification("Fetching updates...") | ||
104 | ResourcesModel.updateAction.triggered() | 93 | ResourcesModel.updateAction.triggered() | ||
105 | refreshing = false | 94 | refreshing = false | ||
▲ Show 20 Lines • Show All 185 Lines • Show Last 20 Lines |
Why move to the center?