From f681ef0f4f7520db786ff2c4350cd30b3d67f778 Mon Sep 17 00:00:00 2001 From: Bart De Vries <bart@mogwai.be> Date: Fri, 16 Apr 2021 11:21:19 +0200 Subject: [PATCH] Change to inline header for EntryPage This includes a minor update to GenericListHeader --- src/qml/EntryPage.qml | 40 +++++++++++++++++++++-------------- src/qml/GenericListHeader.qml | 6 ++---- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/qml/EntryPage.qml b/src/qml/EntryPage.qml index 92661915..8f7081a9 100644 --- a/src/qml/EntryPage.qml +++ b/src/qml/EntryPage.qml @@ -21,24 +21,31 @@ Kirigami.ScrollablePage { title: entry.title - header: GenericListHeader { - image: entry.image - title: entry.title - subtitle: entry.feed.name + padding: 0 // needed to get the inline header to fill the page + + ColumnLayout { + GenericListHeader { + id: infoHeader + Layout.fillWidth: true + image: entry.image + title: entry.title + subtitle: entry.feed.name + } + + Controls.Label { + Layout.margins: Kirigami.Units.gridUnit + id: text + text: page.entry.content + baseUrl: page.entry.baseUrl + textFormat: Text.RichText + wrapMode: Text.WordWrap + Layout.fillWidth: true + Layout.fillHeight: true + onLinkActivated: Qt.openUrlExternally(link) + //onWidthChanged: { text = entry.adjustedContent(width, font.pixelSize) } + } } - Controls.Label { - width: page.width - 30 - id: text - text: page.entry.content - baseUrl: page.entry.baseUrl - textFormat: Text.RichText - wrapMode: Text.WordWrap - Layout.fillWidth: true - Layout.fillHeight: true - onLinkActivated: Qt.openUrlExternally(link) - //onWidthChanged: { text = entry.adjustedContent(width, font.pixelSize) } - } actions.main: Kirigami.Action { text: !entry.enclosure ? i18n("Open in Browser") : entry.enclosure.status === Enclosure.Downloadable ? i18n("Download") : @@ -62,3 +69,4 @@ Kirigami.ScrollablePage { onTriggered: { DataManager.addToQueue(entry) } } } + diff --git a/src/qml/GenericListHeader.qml b/src/qml/GenericListHeader.qml index b9d0423a..6b3bed64 100644 --- a/src/qml/GenericListHeader.qml +++ b/src/qml/GenericListHeader.qml @@ -19,10 +19,8 @@ Item { property string subtitle: "" property var headerHeight: Kirigami.Units.gridUnit * 8 - //anchors.top: parent.top // this seems to cause an anchor loop - anchors.right: parent.right - anchors.left: parent.left - height: headerHeight + implicitHeight: headerHeight + implicitWidth: parent.width Image { id: backgroundimage