Warning, /plasma/kdeplasma-addons/applets/comic/package/contents/ui/FullViewWidget.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * SPDX-FileCopyrightText: 2012 Reza Fatahilah Shah <rshah0385@kireihana.com>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 import QtQuick 2.1
0008 import org.kde.plasma.core as PlasmaCore
0009 import org.kde.plasma.components 3.0 as PlasmaComponents
0010 import org.kde.kquickcontrolsaddons 2.0
0011 import QtQuick.Layouts 1.1
0012 import org.kde.plasma.plasmoid
0013 
0014 PlasmaCore.Dialog {
0015     id: root
0016 
0017     property alias image: comicPicture.image
0018 
0019     flags: Qt.Popup
0020     visible: false
0021 
0022     function toggleVisibility()
0023     {
0024         root.visible = !root.visible;
0025         if (root.visible) {
0026             Plasmoid.positionFullView(root);
0027             root.activateWindow;
0028         }
0029     }
0030 
0031     function close() {
0032         root.visible = false;
0033     }
0034 
0035     mainItem: PlasmaComponents.ScrollView {
0036         id: mainScrollArea
0037 
0038         anchors.fill: parent
0039 
0040         Layout.minimumWidth: comicPicture.nativeWidth
0041         Layout.maximumWidth: Layout.minimumWidth
0042         Layout.minimumHeight: comicPicture.nativeHeight
0043         Layout.maximumHeight: Layout.minimumHeight
0044 
0045         Flickable {
0046             id: viewContainer
0047 
0048             anchors.fill: parent
0049 
0050             contentWidth: comicPicture.nativeWidth
0051             contentHeight: comicPicture.nativeHeight
0052 
0053             //clip: true
0054 
0055             QImageItem {
0056                 id: comicPicture
0057 
0058                 anchors.fill: parent
0059 
0060                 smooth: true
0061                 fillMode: QImageItem.PreserveAspectFit
0062 
0063                 MouseArea {
0064                     id: dialogMouseArea
0065 
0066                     anchors.fill: comicPicture
0067 
0068                     onClicked: {
0069                         root.close();
0070                     }
0071                 }
0072             }
0073         }
0074     }
0075 }