From 890f9846b3223f67aff82d7e86193769582ca4f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sun, 7 Mar 2021 08:55:51 +0100 Subject: [PATCH] Support HTML content in the synopsis within the current comic banner --- YACReaderLibrary/qml/GridComicsView.qml | 60 ++++++++++++++++++++----- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/YACReaderLibrary/qml/GridComicsView.qml b/YACReaderLibrary/qml/GridComicsView.qml index f540a357..1df98bc9 100644 --- a/YACReaderLibrary/qml/GridComicsView.qml +++ b/YACReaderLibrary/qml/GridComicsView.qml @@ -612,7 +612,7 @@ Rectangle { } } - Text { + ScrollView { Layout.topMargin: 6 Layout.rightMargin: 30 Layout.bottomMargin: 5 @@ -620,15 +620,55 @@ Rectangle { Layout.maximumHeight: (currentComicVisualView.height * 0.32) Layout.maximumWidth: 960 - id: currentComicInfoSinopsis - color: infoTitleColor - font.family: "Arial" - font.pixelSize: 14 - wrapMode: Text.WordWrap - elide: Text.ElideRight - horizontalAlignment: Text.AlignJustify - text: currentComicInfo.synopsis ? currentComicInfo.synopsis : "" - visible: currentComicInfo.synopsis ? true : false + contentItem: currentComicInfoSinopsis + + horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff + + id: synopsisScroller + + style: ScrollViewStyle { + transientScrollBars: false + incrementControl: Item {} + decrementControl: Item {} + handle: Item { + implicitWidth: 12 + implicitHeight: 26 + Rectangle { + color: "#424246" + anchors.fill: parent + anchors.topMargin: 6 + anchors.leftMargin: 9 + anchors.rightMargin: 0 + anchors.bottomMargin: 6 + radius: 2 + } + } + scrollBarBackground: Item { + implicitWidth: 14 + implicitHeight: 26 + } + } + + Text { + Layout.maximumWidth: 960 + + width: synopsisScroller.width + + id: currentComicInfoSinopsis + color: infoTitleColor + font.family: "Arial" + font.pixelSize: 14 + wrapMode: Text.WordWrap + + text: '' + currentComicInfo.synopsis + '' + visible: currentComicInfo.synopsis + textFormat: Text.RichText + } } }