Warning, /graphics/krita/libs/libqml/qml/panels/PanelDropArea.qml is written in an unsupported language. File is not indexed.

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2012 Arjen Hiemstra <ahiemstra@heimr.nl>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 import QtQuick 2.3
0008 import org.krita.sketch 1.0
0009 import org.krita.draganddrop 1.0 as DnD
0010 
0011 DnD.DropArea {
0012     id: base;
0013 
0014     property string state: "collapsed";
0015 
0016     onYChanged: {
0017         if (children.length > 0) {
0018             if (Constants.IsLandscape && y > 0) {
0019                 children[0].roundTop = true;
0020             }
0021             else {
0022                 children[0].roundTop = false;
0023             }
0024         }
0025     }
0026 
0027     onDragEnter: {
0028         event.accept(Qt.MoveAction);
0029     }
0030 
0031     onDrop: {
0032         var item = event.mimeData.source;
0033         if (children.length > 0) {
0034             children[0].state = "collapsed";
0035             children[0].parent = item.lastArea;
0036         }
0037         item.parent = base;
0038     }
0039 
0040     onChildrenChanged: {
0041         if (children.length > 0) {
0042             var item = children[0];
0043             item.state = base.state;
0044             item.lastArea = base;
0045             item.x = 0;
0046             item.y = 0;
0047             item.width = width;
0048             item.height = height;
0049             item.roundTop = (Constants.IsLandscape && y > 0);
0050         }
0051     }
0052 }