2024-01-29 18:03:44 +08:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Layouts
|
|
|
|
import QtQuick.Window
|
|
|
|
import QtQuick.Controls
|
|
|
|
import FluentUI
|
|
|
|
import "../component"
|
|
|
|
|
|
|
|
FluContentPage{
|
|
|
|
|
|
|
|
title:"SplitLayout"
|
|
|
|
|
2024-01-29 20:19:17 +08:00
|
|
|
RowLayout{
|
|
|
|
id:layout_dropdown
|
|
|
|
anchors{
|
|
|
|
top: parent.top
|
|
|
|
topMargin: 20
|
|
|
|
}
|
|
|
|
FluText{
|
|
|
|
text:"orientation:"
|
|
|
|
}
|
|
|
|
FluDropDownButton{
|
|
|
|
id:btn_orientation
|
2024-01-30 15:10:06 +08:00
|
|
|
Layout.preferredWidth: 120
|
2024-01-29 20:19:17 +08:00
|
|
|
text:"Horizontal"
|
|
|
|
FluMenuItem{
|
|
|
|
text:"Horizontal"
|
|
|
|
onClicked: {
|
|
|
|
btn_orientation.text = text
|
|
|
|
split_layout.orientation = Qt.Horizontal
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FluMenuItem{
|
|
|
|
text:"Vertical"
|
|
|
|
onClicked: {
|
|
|
|
btn_orientation.text = text
|
|
|
|
split_layout.orientation = Qt.Vertical
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FluSplitLayout {
|
|
|
|
id:split_layout
|
|
|
|
anchors{
|
|
|
|
top: layout_dropdown.bottom
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
|
|
|
bottom: parent.bottom
|
|
|
|
topMargin: 8
|
|
|
|
}
|
|
|
|
orientation: Qt.Horizontal
|
|
|
|
Item {
|
|
|
|
clip: true
|
|
|
|
implicitWidth: 200
|
|
|
|
implicitHeight: 200
|
|
|
|
SplitView.maximumWidth: 400
|
|
|
|
SplitView.maximumHeight: 400
|
|
|
|
FluText {
|
|
|
|
text: "Page 1"
|
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Item {
|
|
|
|
clip: true
|
|
|
|
id: centerItem
|
|
|
|
SplitView.minimumWidth: 50
|
|
|
|
SplitView.minimumHeight: 50
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
FluText {
|
|
|
|
text: "Page 2"
|
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Item {
|
|
|
|
clip: true
|
|
|
|
implicitWidth: 200
|
|
|
|
implicitHeight: 200
|
|
|
|
FluText {
|
|
|
|
text: "Page 3"
|
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-01-29 18:03:44 +08:00
|
|
|
}
|