diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-02-29 23:29:43 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-03-04 21:34:52 +0100 |
commit | eb4a66480356356b19969f13553e4179b24c4041 (patch) | |
tree | e07175ccb1cc52e69b72ddfc2c04b63160857bfa /src/pdf | |
parent | 25e76f19fb3e92aca05e108f823e0e8e822ee2dc (diff) |
Render PDF link decorations as dashed underlines rather than boxes
So they look more like (old-school) web links.
The underlines are always horizontal and underneath the area of
occurrence though; rotated link text has not been tested.
Change-Id: I4fc01d88367b0cc9bbc23e9f85a3b42efb271fb8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/pdf')
-rw-r--r-- | src/pdf/quick/qml/PdfMultiPageView.qml | 12 | ||||
-rw-r--r-- | src/pdf/quick/qml/PdfScrollablePageView.qml | 12 |
2 files changed, 18 insertions, 6 deletions
diff --git a/src/pdf/quick/qml/PdfMultiPageView.qml b/src/pdf/quick/qml/PdfMultiPageView.qml index de61f1782..9d9e2800a 100644 --- a/src/pdf/quick/qml/PdfMultiPageView.qml +++ b/src/pdf/quick/qml/PdfMultiPageView.qml @@ -282,13 +282,19 @@ Item { document: root.document page: image.currentFrame } - delegate: Rectangle { - color: "transparent" - border.color: "lightgrey" + delegate: Shape { x: rect.x * paper.pageScale y: rect.y * paper.pageScale width: rect.width * paper.pageScale height: rect.height * paper.pageScale + ShapePath { + strokeWidth: 1 + strokeColor: "steelblue" + strokeStyle: ShapePath.DashLine + dashPattern: [ 1, 4 ] + startX: 0; startY: height + PathLine { x: width; y: height } + } MouseArea { // TODO switch to TapHandler / HoverHandler in 5.15 id: linkMA anchors.fill: parent diff --git a/src/pdf/quick/qml/PdfScrollablePageView.qml b/src/pdf/quick/qml/PdfScrollablePageView.qml index e27b21d14..2d335849d 100644 --- a/src/pdf/quick/qml/PdfScrollablePageView.qml +++ b/src/pdf/quick/qml/PdfScrollablePageView.qml @@ -213,13 +213,19 @@ Flickable { document: root.document page: navigationStack.currentPage } - delegate: Rectangle { - color: "transparent" - border.color: "lightgrey" + delegate: Shape { x: rect.x * image.pageScale y: rect.y * image.pageScale width: rect.width * image.pageScale height: rect.height * image.pageScale + ShapePath { + strokeWidth: 1 + strokeColor: "steelblue" + strokeStyle: ShapePath.DashLine + dashPattern: [ 1, 4 ] + startX: 0; startY: height + PathLine { x: width; y: height } + } MouseArea { // TODO switch to TapHandler / HoverHandler in 5.15 anchors.fill: parent cursorShape: Qt.PointingHandCursor |