Warning, /graphics/okular/mobile/components/private/PageView.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
0003
0004 SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006
0007 import QtQuick 2.15
0008 import Qt5Compat.GraphicalEffects
0009 import org.kde.okular 2.0
0010 import org.kde.kirigami 2.17 as Kirigami
0011
0012 Item {
0013 width: parent.width
0014 height: parent.height
0015 readonly property PageItem pageItem: page
0016 property alias document: page.document
0017 property alias pageNumber: page.pageNumber
0018 implicitWidth: page.implicitWidth
0019 implicitHeight: page.implicitHeight
0020 readonly property real pageRatio: page.implicitWidth / page.implicitHeight
0021 readonly property real scaleFactor: page.width / page.implicitWidth
0022
0023 PageItem {
0024 id: page
0025 property bool sameOrientation: parent.width / parent.height > pageRatio
0026 anchors.centerIn: parent
0027 width: sameOrientation ? parent.height * pageRatio : parent.width
0028 height: !sameOrientation ? parent.width / pageRatio : parent.height
0029 document: null
0030 }
0031
0032 Rectangle {
0033 id: backgroundRectangle
0034 anchors {
0035 top: parent.top
0036 bottom: parent.bottom
0037 left: page.left
0038 right: page.right
0039 topMargin: -Kirigami.Units.gridUnit
0040 bottomMargin: -Kirigami.Units.gridUnit
0041 }
0042 z: -1
0043 color: "white"
0044
0045 LinearGradient {
0046 width: Kirigami.Units.gridUnit
0047 anchors {
0048 right: parent.left
0049 top: parent.top
0050 bottom: parent.bottom
0051 }
0052 start: Qt.point(0, 0)
0053 end: Qt.point(Kirigami.Units.gridUnit, 0)
0054 gradient: Gradient {
0055 GradientStop {
0056 position: 0.0
0057 color: "transparent"
0058 }
0059 GradientStop {
0060 position: 0.7
0061 color: Qt.rgba(0, 0, 0, 0.08)
0062 }
0063 GradientStop {
0064 position: 1.0
0065 color: Qt.rgba(0, 0, 0, 0.2)
0066 }
0067 }
0068 }
0069
0070 LinearGradient {
0071 width: Kirigami.Units.gridUnit
0072 anchors {
0073 left: parent.right
0074 top: parent.top
0075 bottom: parent.bottom
0076 }
0077 start: Qt.point(0, 0)
0078 end: Qt.point(Kirigami.Units.gridUnit, 0)
0079 gradient: Gradient {
0080 GradientStop {
0081 position: 0.0
0082 color: Qt.rgba(0, 0, 0, 0.2)
0083 }
0084 GradientStop {
0085 position: 0.3
0086 color: Qt.rgba(0, 0, 0, 0.08)
0087 }
0088 GradientStop {
0089 position: 1.0
0090 color: "transparent"
0091 }
0092 }
0093 }
0094 }
0095 }