Warning, /frameworks/plasma-framework/tests/dialog_visualParentChange.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 SPDX-FileCopyrightText: 2014 Vishesh Handa <vhanda@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 import QtQuick 2.0 0008 0009 import QtQuick.Controls 2.15 as Controls 0010 import QtQuick.Layouts 1.1 0011 0012 import org.kde.plasma.core 2.0 as PlasmaCore 0013 0014 ColumnLayout { 0015 Controls.Label { 0016 Layout.maximumWidth: mainLayout.width 0017 wrapMode: Text.WordWrap 0018 text: "Click on each coloured box to make a dialog popup. It should popup in the correct position. The popup should also move from one rectangle to the other on hovering" 0019 } 0020 0021 RowLayout { 0022 id: mainLayout 0023 Rectangle { 0024 width: 300 0025 height: 100 0026 color: "red" 0027 0028 MouseArea { 0029 anchors.fill: parent 0030 hoverEnabled: true 0031 onClicked: { 0032 dialog.visualParent = parent; 0033 dialog.visible = !dialog.visible; 0034 } 0035 onEntered: { 0036 dialog.visualParent = parent; 0037 } 0038 } 0039 } 0040 0041 Rectangle { 0042 width: 300 0043 height: 100 0044 color: "blue" 0045 0046 MouseArea { 0047 anchors.fill: parent 0048 hoverEnabled: true 0049 onClicked: { 0050 dialog.visualParent = parent; 0051 dialog.visible = !dialog.visible; 0052 } 0053 onEntered: { 0054 dialog.visualParent = parent; 0055 } 0056 } 0057 } 0058 0059 Rectangle { 0060 width: 300 0061 height: 100 0062 color: "green" 0063 0064 MouseArea { 0065 anchors.fill: parent 0066 hoverEnabled: true 0067 onClicked: { 0068 dialog.visualParent = parent; 0069 dialog.visible = !dialog.visible; 0070 } 0071 onEntered: { 0072 dialog.visualParent = parent; 0073 } 0074 } 0075 } 0076 0077 Rectangle { 0078 width: 300 0079 height: 100 0080 color: "yellow" 0081 0082 MouseArea { 0083 anchors.fill: parent 0084 hoverEnabled: true 0085 onClicked: { 0086 dialog.visualParent = parent; 0087 dialog.visible = !dialog.visible; 0088 } 0089 onEntered: { 0090 dialog.visualParent = parent; 0091 } 0092 } 0093 } 0094 0095 PlasmaCore.Dialog { 0096 id: dialog 0097 location: PlasmaCore.Types.BottomEdge 0098 visible: false 0099 0100 Rectangle { 0101 color: "black" 0102 width: 150 0103 height: 150 0104 } 0105 } 0106 } 0107 }