diff --git a/discover/qml/SourcesPage.qml b/discover/qml/SourcesPage.qml --- a/discover/qml/SourcesPage.qml +++ b/discover/qml/SourcesPage.qml @@ -49,59 +49,69 @@ } } - Kirigami.ActionToolBar { - id: actionBar - Layout.fillWidth: true - alignment: Qt.AlignRight - Kirigami.Action { - id: addSource - text: i18n("Add Source...") - icon.name: "list-add" - visible: backendItem.backend && backendItem.backend.supportsAdding + contentItem: RowLayout { + Kirigami.Heading { + level: 3; + text: backendItem.label; + Layout.fillWidth: true; + Layout.maximumWidth: contentWidth + } - readonly property Component p0: Component { - id: dialogComponent - AddSourceDialog { - source: backendItem.backend - onVisibleChanged: if (!visible) { - destroy() + Kirigami.ActionToolBar { + id: actionBar + Layout.fillWidth: true + alignment: Qt.AlignRight + Kirigami.Action { + id: addSource + text: i18n("Add Source...") + icon.name: "list-add" + visible: backendItem.backend && backendItem.backend.supportsAdding + + readonly property Component p0: Component { + id: dialogComponent + AddSourceDialog { + source: backendItem.backend + onVisibleChanged: if (!visible) { + destroy() + } } } - } - onTriggered: { - var addSourceDialog = dialogComponent.createObject(null, {displayName: backendItem.backend.resourcesBackend.displayName }) - addSourceDialog.open() + onTriggered: { + var addSourceDialog = dialogComponent.createObject(null, {displayName: backendItem.backend.resourcesBackend.displayName }) + addSourceDialog.open() + } } - } - Kirigami.Action { - id: makeDefault - visible: resourcesBackend && resourcesBackend.hasApplications + Kirigami.Action { + id: makeDefault + visible: resourcesBackend && resourcesBackend.hasApplications - enabled: !backendItem.isDefault - text: i18n("Make default") - icon.name: "favorite" - onTriggered: ResourcesModel.currentApplicationBackend = backendItem.backend.resourcesBackend - } + enabled: !backendItem.isDefault + text: i18n("Make default") + icon.name: "favorite" + onTriggered: ResourcesModel.currentApplicationBackend = backendItem.backend.resourcesBackend + } - Component { - id: kirigamiAction - Kirigami.Action { - property QtObject action - text: action.text - tooltip: action.toolTip - onTriggered: action.trigger() + Component { + id: kirigamiAction + Kirigami.Action { + property QtObject action + text: action.text + tooltip: action.toolTip + enabled: action.enabled + onTriggered: action.trigger() + } } - } - function mergeActions(moreActions) { - var actions = [makeDefault, addSource] - for(var i in moreActions) { - actions.push(kirigamiAction.createObject(null, {action: moreActions[i]})) + function mergeActions(moreActions) { + var actions = [makeDefault, addSource] + for(var i in moreActions) { + actions.push(kirigamiAction.createObject(null, {action: moreActions[i]})) + } + return actions; } - return actions; + actions: mergeActions(backendItem.backend.actions) } - actions: mergeActions(backendItem.backend.actions) } }