Commit eac67d4f authored by Nate Graham's avatar Nate Graham 💤
Browse files

[Updates page] Add text to the checkbox instead of putting it in a separate label

Test Plan: Works fine and clicking on the text now toggles the checkbox.

Reviewers: apol, #discover_software_store, broulik

Reviewed By: apol, #discover_software_store

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D24712
parent dd9ba961
......@@ -113,30 +113,21 @@ DiscoverPage
Kirigami.Theme.inherit: false
visible: (updateModel.totalUpdatesCount > 0 && resourcesUpdatesModel.isProgressing) || updateModel.hasUpdates
RowLayout {
anchors.fill: parent
enabled: updateAction.enabled
CheckBox {
Layout.leftMargin: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing
enabled: !resourcesUpdatesModel.isProgressing && !ResourcesModel.isFetching
tristate: true
checkState: updateModel.toUpdateCount === 0 ? Qt.Unchecked
: updateModel.toUpdateCount === updateModel.totalUpdatesCount ? Qt.Checked
: Qt.PartiallyChecked
onClicked: {
if (updateModel.toUpdateCount === 0)
updateModel.checkAll()
else
updateModel.uncheckAll()
}
}
CheckBox {
Layout.leftMargin: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing
Layout.fillWidth: true
text: page.unselected === 0 ? i18n("All updates selected (%1)", updateModel.updateSize) : i18np("%1/%2 update selected (%3)", "%1/%2 updates selected (%3)", updateModel.toUpdateCount, updateModel.totalUpdatesCount, updateModel.updateSize)
enabled: updateAction.enabled && !resourcesUpdatesModel.isProgressing && !ResourcesModel.isFetching
tristate: true
checkState: updateModel.toUpdateCount === 0 ? Qt.Unchecked
: updateModel.toUpdateCount === updateModel.totalUpdatesCount ? Qt.Checked
: Qt.PartiallyChecked
Label {
Layout.fillWidth: true
text: page.unselected === 0 ? i18n("All updates selected (%1)", updateModel.updateSize) : i18np("%1/%2 update selected (%3)", "%1/%2 updates selected (%3)", updateModel.toUpdateCount, updateModel.totalUpdatesCount, updateModel.updateSize)
elide: Text.ElideRight
onClicked: {
if (updateModel.toUpdateCount === 0)
updateModel.checkAll()
else
updateModel.uncheckAll()
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment