From 1e2d0fa10631f4850ceae4b2ad07a935f77dd692 Mon Sep 17 00:00:00 2001 From: olf Date: Sat, 30 Mar 2024 23:12:03 +0100 Subject: [PATCH 1/3] [qml/pages/ComicInfoPage.qml] Overhaul & align with `ComicInfoPanel.qml` --- qml/pages/ComicInfoPage.qml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qml/pages/ComicInfoPage.qml b/qml/pages/ComicInfoPage.qml index 79dc0a8f..be9cdd00 100644 --- a/qml/pages/ComicInfoPage.qml +++ b/qml/pages/ComicInfoPage.qml @@ -1,7 +1,7 @@ /** * Copyright (c) 2015 Damien Tardy-Panis - * Copyright (c) 2018-2019 Oleg Linkin - * Copyright (c) 2023 olf + * Copyright (c) 2018,2019 Oleg Linkin + * Copyright (c) 2023,2024 olf * * This file is subject to the terms and conditions defined in * file `LICENSE.txt`, which is part of this source code package. @@ -45,6 +45,11 @@ Page { PageHeader { title: qsTr("Comic info") } + DetailItem { + id: nameHeaderLabel + label: qsTr("Name") + value: comic.name + } DetailItem { id: authorsHeaderLabel label: comic.authors.length > 1 ? qsTr("Authors") : qsTr("Author") From 7583a79e09e2bdf66c7768d2a203a0ef2b0bdc1b Mon Sep 17 00:00:00 2001 From: olf Date: Mon, 1 Apr 2024 18:52:29 +0200 Subject: [PATCH 2/3] [ComicInfoPage.qml] Adapt to `../components/ComicInfoPanel.qml` --- qml/pages/ComicInfoPage.qml | 107 +++++++++++++++++++++++++++++------- 1 file changed, 88 insertions(+), 19 deletions(-) diff --git a/qml/pages/ComicInfoPage.qml b/qml/pages/ComicInfoPage.qml index be9cdd00..3d462ee8 100644 --- a/qml/pages/ComicInfoPage.qml +++ b/qml/pages/ComicInfoPage.qml @@ -35,30 +35,88 @@ Page { SilicaFlickable { anchors.fill: parent - contentHeight: column.height + contentHeight: infoColumn.height + PageHeader { + title: qsTr("Comic info") + } + + // The content of this Column {} is very similar to the one in qml/components/ComicInfoPage.qml: + // One may consider to unify them as an own component, but that likely would have to be parametrised. Column { - id: column + id: infoColumn + spacing: Theme.paddingMedium + anchors.centerIn: parent + width: parent.width - 2 * Theme.paddingMedium - width: parent.width + Grid { + columns: 2 + spacing: Theme.paddingMedium - PageHeader { - title: qsTr("Comic info") - } - DetailItem { - id: nameHeaderLabel - label: qsTr("Name") - value: comic.name - } - DetailItem { - id: authorsHeaderLabel - label: comic.authors.length > 1 ? qsTr("Authors") : qsTr("Author") - value: comic.authors.join("\n") + Label { + id: nameHeaderLabel + text: qsTr("Name") + " " + font { + italic: true + pixelSize: Theme.fontSizeMedium + } + color: Theme.secondaryColor + } + + Label { + id: nameLabel + text: comic.name + width: parent.width + font.pixelSize: Theme.fontSizeMedium + truncationMode: TruncationMode.Fade + } + + Label { + id: authorsHeaderLabel + text: comic.authors.length > 1 ? qsTr("Authors") + " " : qsTr("Author") + " " + font { + italic: true + pixelSize: Theme.fontSizeMedium + } + color: Theme.secondaryColor + } + + Label { + id: authorsLabel + text: comic.authors.join("\n") + font.pixelSize: Theme.fontSizeMedium + truncationMode: TruncationMode.Fade + } + + Label { + id: languageHeaderLabel + text: qsTr("Language") + " " + font { + italic: true + pixelSize: Theme.fontSizeMedium + } + color: Theme.secondaryColor + } + + Label { + id: languageLabel + text: comic.language + font.pixelSize: Theme.fontSizeMedium + truncationMode: TruncationMode.Fade + } } - DetailItem { - id: languageHeaderLabel - label: qsTr("Language") - value: comic.language + + Label { + id: exampleImageHeaderLabel + text: qsTr("Example") + font { + italic: true + pixelSize: Theme.fontSizeMedium + } + color: Theme.secondaryColor + width: parent.width + horizontalAlignment: Text.AlignHCenter + anchors.horizontalCenter: parent.horizontalCenter } Image { @@ -68,9 +126,20 @@ Page { smooth: true asynchronous: true + width: parent.width + anchors.horizontalCenter: parent.horizontalCenter } } VerticalScrollDecorator { } } + + PullDownMenu { + id: homepagePullDownMenu + + MenuItem { + text: qsTr("Go to homepage") + onClicked: Qt.openUrlExternally(comic.homepage) + } + } } From 934b5748032b85858813eb65aad47c8d097fbb31 Mon Sep 17 00:00:00 2001 From: olf Date: Mon, 1 Apr 2024 21:51:04 +0200 Subject: [PATCH 3/3] [ComicInfoPage.qml] Use `Theme.horizontalPageMargin` instead of `2 * Theme.paddingMedium` --- qml/pages/ComicInfoPage.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qml/pages/ComicInfoPage.qml b/qml/pages/ComicInfoPage.qml index 3d462ee8..948416da 100644 --- a/qml/pages/ComicInfoPage.qml +++ b/qml/pages/ComicInfoPage.qml @@ -35,9 +35,10 @@ Page { SilicaFlickable { anchors.fill: parent - contentHeight: infoColumn.height + contentHeight: pageHeader.height + infoColumn.height + Theme.verticalPageMargin PageHeader { + id: pageHeader title: qsTr("Comic info") } @@ -47,7 +48,7 @@ Page { id: infoColumn spacing: Theme.paddingMedium anchors.centerIn: parent - width: parent.width - 2 * Theme.paddingMedium + width: parent.width - Theme.horizontalPageMargin Grid { columns: 2