2014-09-29 10:28:31 +02:00
|
|
|
/*
|
2020-08-13 21:08:54 +02:00
|
|
|
SPDX-FileCopyrightText: 2014 Vishesh Handa <vhanda@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2014 Marco Martin <mart@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2014-09-29 10:28:31 +02:00
|
|
|
|
|
|
|
import QtQuick 2.0
|
|
|
|
|
|
|
|
import QtQuick.Controls 1.1 as Controls
|
|
|
|
import QtQuick.Layouts 1.1
|
|
|
|
|
|
|
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
Layout.minimumWidth: 300
|
|
|
|
Layout.minimumHeight: 300
|
|
|
|
Controls.Button {
|
|
|
|
id: button
|
|
|
|
anchors.centerIn: parent
|
|
|
|
text: "Show Dialog"
|
|
|
|
onClicked: {
|
|
|
|
//changing the minimumHeight of the mainItem of an hidden dialog
|
|
|
|
//shouldn't
|
|
|
|
rect.Layout.minimumHeight = rect.Layout.minimumHeight + 1
|
|
|
|
rect.Layout.minimumWidth = rect.Layout.minimumWidth + 1
|
|
|
|
subDialog.visible = !subDialog.visible
|
|
|
|
}
|
|
|
|
}
|
|
|
|
PlasmaCore.Dialog {
|
|
|
|
id: subDialog
|
|
|
|
location: PlasmaCore.Types.Floating
|
|
|
|
visualParent: button
|
|
|
|
visible: false
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: rect
|
|
|
|
Layout.minimumWidth: 300
|
|
|
|
Layout.minimumHeight: 300
|
|
|
|
Layout.maximumHeight: 500
|
|
|
|
property int fixedHeight: 500
|
|
|
|
width: 500
|
|
|
|
height: fixedHeight
|
|
|
|
|
2014-09-29 14:31:04 +02:00
|
|
|
color: "red"
|
|
|
|
border {
|
|
|
|
color: "blue"
|
|
|
|
width: 3
|
|
|
|
}
|
2014-09-29 10:28:31 +02:00
|
|
|
|
|
|
|
Controls.Button {
|
|
|
|
text: "Resize"
|
|
|
|
anchors.centerIn: parent
|
|
|
|
onClicked: {
|
|
|
|
rect.fixedHeight = rect.Layout.minimumHeight = rect.Layout.maximumHeight = (rect.fixedHeight == 500 ? rect.fixedHeight = 100 : rect.fixedHeight = 500)
|
2014-09-29 14:31:04 +02:00
|
|
|
|
|
|
|
//subDialog.height = (subDialog.height == 500 ? subDialog.height = 100 : subDialog.height = 500)
|
2014-09-29 10:28:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|