Warning, /graphics/koko/src/qml/InfoDrawer.qml is written in an unsupported language. File is not indexed.

0001 /* SPDX-FileCopyrightText: 2021 Carl Schwan <carlschwan@kde.org>
0002  * SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
0003  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0004  */
0005 
0006 import QtQuick 2.15
0007 import QtQml 2.15
0008 import QtQuick.Window 2.15
0009 import QtQuick.Templates 2.15 as T
0010 import QtQuick.Controls 2.15 as QQC2
0011 import QtQuick.Layouts 1.15
0012 import org.kde.kirigami 2.15 as Kirigami
0013 import org.kde.koko 0.1 as Koko
0014 import org.kde.koko.private 0.1 as KokoPrivate
0015 
0016 Kirigami.OverlayDrawer {
0017     id: root
0018     property Koko.Exiv2Extractor extractor
0019     drawerOpen: false
0020     edge: Qt.application.layoutDirection == Qt.RightToLeft ? Qt.LeftEdge : Qt.RightEdge
0021     handleVisible: false
0022 
0023     leftPadding: root.mirrored && vScrollBar.visible ? vScrollBar.width : 0
0024     rightPadding: !root.mirrored && vScrollBar.visible ? vScrollBar.width : 0
0025     topPadding: Math.ceil(header.implicitHeight) + header.y
0026     bottomPadding: 0
0027 
0028     Kirigami.Heading {
0029         id: header
0030         parent: content.parent
0031         z: 1
0032         anchors.top: parent.top
0033         anchors.left: parent.left
0034         anchors.leftMargin: Kirigami.Units.largeSpacing
0035         anchors.topMargin: Kirigami.Units.largeSpacing
0036         horizontalAlignment: Qt.AlignLeft
0037         verticalAlignment: Qt.AlignVCenter
0038         level: 2
0039         text: i18n("Metadata")
0040     }
0041 
0042     // QQC2 ScrollView makes it surprisingly difficult to control the
0043     // content size and implicit size without binding loops or glitches.
0044     // ScrollView completely ignores the Flickable's implicit size.
0045     // Using plain Flickable with ScrollBar instead.
0046     contentItem: InfoDrawerSidebarBase {
0047         id: content
0048         extractor: root.extractor
0049         topMargin: 0
0050         QQC2.ScrollBar.vertical: QQC2.ScrollBar {
0051             id: vScrollBar
0052             parent: content.parent
0053             anchors.left: parent.contentItem.right
0054             anchors.top: parent.top
0055             anchors.bottom: parent.bottom
0056         }
0057     }
0058     Component.onCompleted: root.open()
0059 }