Warning, /plasma/libplasma/tests/dialog_positioning_parentrotated.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2014 Vishesh Handa <vhanda@kde.org>
0003     SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 import QtQuick 2.0
0009 
0010 import QtQuick.Controls 2.15 as Controls
0011 import QtQuick.Layouts 1.1
0012 
0013 import org.kde.plasma.core 2.0 as PlasmaCore
0014 import org.kde.plasma.components 2.0 as PlasmaComponents
0015 import org.kde.plasma.extras 2.0 as PlasmaExtras
0016 
0017 ColumnLayout
0018 {
0019     height: PlasmaCore.Units.gridUnit * 20
0020     Controls.Label {
0021         id: label
0022         text: "Press the button and make sure the popup is on the correct place"
0023         wrapMode: Text.WordWrap
0024     }
0025     PlasmaComponents.Button {
0026         id: settingsButton
0027         iconSource: "configure"
0028         text: "Press Me"
0029         Layout.alignment: Qt.AlignHCenter
0030         rotation: 90
0031 
0032         onClicked: {
0033             contextMenu.visible = !contextMenu.visible;
0034         }
0035     }
0036 
0037     PlasmaCore.Dialog {
0038         id: contextMenu
0039         visualParent: settingsButton
0040 
0041         location: PlasmaCore.Types.BottomEdge
0042         type: PlasmaCore.Dialog.PopupMenu
0043         flags: Qt.Popup | Qt.FramelessWindowHint | Qt.WindowDoesNotAcceptFocus
0044 
0045         mainItem: ColumnLayout {
0046             id: menuColumn
0047             Layout.minimumWidth: menuColumn.implicitWidth
0048             Layout.minimumHeight: menuColumn.implicitHeight
0049             spacing: PlasmaCore.Units.smallSpacing
0050 
0051             PlasmaExtras.Heading {
0052                 level: 3
0053                 text: "Panel Alignment"
0054             }
0055 
0056             PlasmaComponents.ButtonColumn {
0057                 spacing: 0
0058                 Layout.fillWidth: true
0059                 PlasmaComponents.ToolButton {
0060                     anchors {
0061                         left: parent.left
0062                         right: parent.right
0063                     }
0064                     text: "Left"
0065                     checkable: true
0066                     flat: false
0067                 }
0068                 PlasmaComponents.ToolButton {
0069                     anchors {
0070                         left: parent.left
0071                         right: parent.right
0072                     }
0073                     text: "Center"
0074                     checkable: true
0075                     flat: false
0076                 }
0077             }
0078         }
0079     }
0080 }