Dialog Positioning Test2: Simplify the code

This commit is contained in:
Vishesh Handa 2014-08-28 14:59:10 +02:00
parent 15a993cf67
commit a9c5e6d96c

View File

@ -26,15 +26,18 @@ import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.plasma.extras 2.0 as PlasmaExtras
Item { ColumnLayout
width: 400 {
height: 400 Controls.Label {
text: "Press the buttom and make sure the popup is on the correct place"
wrapMode: Text.WordWrap
}
PlasmaComponents.Button { PlasmaComponents.Button {
id: settingsButton id: settingsButton
iconSource: "configure" iconSource: "configure"
text: "More Settings..." text: "Press Me"
Layout.preferredWidth: 100 Layout.alignment: Qt.AlignHCenter
onClicked: { onClicked: {
contextMenu.visible = !contextMenu.visible; contextMenu.visible = !contextMenu.visible;
} }
@ -44,7 +47,7 @@ Item {
id: contextMenu id: contextMenu
visualParent: settingsButton visualParent: settingsButton
//location: plasmoid.location location: PlasmaCore.Types.BottomEdge
type: PlasmaCore.Dialog.PopupMenu type: PlasmaCore.Dialog.PopupMenu
flags: Qt.Popup | Qt.FramelessWindowHint | Qt.WindowDoesNotAcceptFocus flags: Qt.Popup | Qt.FramelessWindowHint | Qt.WindowDoesNotAcceptFocus
@ -81,39 +84,6 @@ Item {
flat: false flat: false
} }
} }
PlasmaExtras.Heading {
level: 3
text: "Visibility"
}
PlasmaComponents.ButtonColumn {
spacing: 0
Layout.fillWidth: true
PlasmaComponents.ToolButton {
anchors {
left: parent.left
right: parent.right
}
text: "Always Visible"
checkable: true
flat: false
}
PlasmaComponents.ToolButton {
anchors {
left: parent.left
right: parent.right
}
text: "Auto Hide"
checkable: true
flat: false
}
}
PlasmaComponents.ToolButton {
Layout.fillWidth: true
text: "Maximize Panel"
iconSource: "zoom-fit-height"
}
} }
} }
} }