diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 2.8.12) set(QT_MIN_VERSION "5.12.0") -set(KF5_MIN_VERSION "5.58.0") +set(KF5_MIN_VERSION "5.62.0") find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) diff --git a/discover/qml/SourcesPage.qml b/discover/qml/SourcesPage.qml --- a/discover/qml/SourcesPage.qml +++ b/discover/qml/SourcesPage.qml @@ -3,7 +3,7 @@ import QtQuick.Layouts 1.1 import org.kde.discover 2.0 import org.kde.discover.app 1.0 -import org.kde.kirigami 2.2 as Kirigami +import org.kde.kirigami 2.10 as Kirigami import "navigation.js" as Navigation DiscoverPage { @@ -28,83 +28,78 @@ currentIndex: -1 section.property: "sourceName" - section.delegate: Kirigami.AbstractListItem { + section.delegate: Kirigami.ListSectionHeader { id: backendItem - hoverEnabled: false - supportsMouseEvents: false + readonly property QtObject backend: SourcesModel.sourcesBackendByName(section) readonly property QtObject resourcesBackend: backend.resourcesBackend readonly property bool isDefault: ResourcesModel.currentApplicationBackend === resourcesBackend - RowLayout { - id: sourceTitleLayout - Layout.fillHeight: true - Connections { - target: backendItem.backend - onPassiveMessage: window.showPassiveNotification(message) - onProceedRequest: { - var dialog = sourceProceedDialog.createObject(window, {sourcesBackend: backendItem.backend, title: title, description: description}) - dialog.open() + width: sourcesView.width + label: backendItem.isDefault ? i18n("%1 (Default)", resourcesBackend.displayName) : resourcesBackend.displayName + + customItems: [ + RowLayout { + id: sourceTitleLayout + Connections { + target: backendItem.backend + onPassiveMessage: window.showPassiveNotification(message) + onProceedRequest: { + var dialog = sourceProceedDialog.createObject(window, {sourcesBackend: backendItem.backend, title: title, description: description}) + dialog.open() + } } - } - Kirigami.Heading { - Layout.fillWidth: true - Layout.leftMargin: Kirigami.Units.smallSpacing - Layout.alignment: Qt.AlignVCenter - text: backendItem.isDefault ? i18n("%1 (Default)", resourcesBackend.displayName) : resourcesBackend.displayName - level: 3 - } - - Instantiator { - id: backendActionsInst - model: ActionsModel { - actions: backendItem.backend ? backendItem.backend.actions : undefined - } - delegate: Button { - parent: sourceTitleLayout - Layout.column: 1 - text: modelData.text - icon.name: app.iconName(modelData.icon) - ToolTip.visible: hovered - ToolTip.text: modelData.toolTip - onClicked: modelData.trigger() - } - onObjectRemoved: { - object.destroy() + Instantiator { + id: backendActionsInst + model: ActionsModel { + actions: backendItem.backend ? backendItem.backend.actions : undefined + } + delegate: Button { + parent: sourceTitleLayout + Layout.column: 1 + text: modelData.text + icon.name: app.iconName(modelData.icon) + ToolTip.visible: hovered + ToolTip.text: modelData.toolTip + onClicked: modelData.trigger() + } + onObjectRemoved: { + object.destroy() + } } - } - Button { - text: i18n("Add Source...") - icon.name: "list-add" - visible: backendItem.backend && backendItem.backend.supportsAdding - - Component { - id: dialogComponent - AddSourceDialog { - source: backendItem.backend - onVisibleChanged: if (!visible) { - destroy() + Button { + text: i18n("Add Source...") + icon.name: "list-add" + visible: backendItem.backend && backendItem.backend.supportsAdding + + Component { + id: dialogComponent + AddSourceDialog { + source: backendItem.backend + onVisibleChanged: if (!visible) { + destroy() + } } } - } - onClicked: { - var addSourceDialog = dialogComponent.createObject(null, {displayName: backendItem.backend.resourcesBackend.displayName }) - addSourceDialog.open() + onClicked: { + var addSourceDialog = dialogComponent.createObject(null, {displayName: backendItem.backend.resourcesBackend.displayName }) + addSourceDialog.open() + } } - } - Button { - visible: resourcesBackend && resourcesBackend.hasApplications + Button { + visible: resourcesBackend && resourcesBackend.hasApplications - enabled: !backendItem.isDefault - text: i18n("Make default") - icon.name: "favorite" - onClicked: ResourcesModel.currentApplicationBackend = backendItem.backend.resourcesBackend + enabled: !backendItem.isDefault + text: i18n("Make default") + icon.name: "favorite" + onClicked: ResourcesModel.currentApplicationBackend = backendItem.backend.resourcesBackend + } } - } + ] } Component { diff --git a/discover/qml/UpdatesPage.qml b/discover/qml/UpdatesPage.qml --- a/discover/qml/UpdatesPage.qml +++ b/discover/qml/UpdatesPage.qml @@ -4,7 +4,7 @@ import org.kde.discover 2.0 import org.kde.discover.app 1.0 import "navigation.js" as Navigation -import org.kde.kirigami 2.3 as Kirigami +import org.kde.kirigami 2.10 as Kirigami DiscoverPage { @@ -207,11 +207,9 @@ section { property: "section" - delegate: Kirigami.Heading { - x: Kirigami.Units.gridUnit - level: 2 - text: section - height: implicitHeight + Kirigami.Units.largeSpacing * 2 + delegate: Kirigami.ListSectionHeader { + width: updatesView.width + label: section } }