fixed recursive rearrange on PageHome

This commit is contained in:
vladimir.kuznetsov 2024-03-25 22:30:44 +05:00
parent 561b62cd40
commit 5206665fa0
2 changed files with 88 additions and 106 deletions

View file

@ -89,12 +89,12 @@ RadioButton {
}
contentItem: Item {
implicitWidth: content.implicitWidth
implicitHeight: content.implicitHeight
anchors.fill: parent
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 8 + background.width
implicitHeight: content.implicitHeight
ColumnLayout {
id: content

View file

@ -299,34 +299,6 @@ PageType {
}
}
Flickable {
id: serversContainer
anchors.top: serversMenuHeader.bottom
anchors.right: parent.right
anchors.left: parent.left
anchors.topMargin: 16
contentHeight: col.height + col.anchors.bottomMargin
implicitHeight: parent.height - serversMenuHeader.implicitHeight
clip: true
ScrollBar.vertical: ScrollBar {
id: scrollBar
policy: serversContainer.height >= serversContainer.contentHeight ? ScrollBar.AlwaysOff : ScrollBar.AlwaysOn
}
Keys.onUpPressed: scrollBar.decrease()
Keys.onDownPressed: scrollBar.increase()
Column {
id: col
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.bottomMargin: 32
spacing: 16
ButtonGroup {
id: serversRadioButtonGroup
@ -334,12 +306,24 @@ PageType {
ListView {
id: serversMenuContent
width: parent.width
height: serversMenuContent.contentItem.height
anchors.top: serversMenuHeader.bottom
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.topMargin: 16
model: ServersModel
currentIndex: ServersModel.defaultIndex
ScrollBar.vertical: ScrollBar {
id: scrollBar
policy: serversMenuContent.height >= serversMenuContent.contentHeight ? ScrollBar.AlwaysOff : ScrollBar.AlwaysOn
}
Keys.onUpPressed: scrollBar.decrease()
Keys.onDownPressed: scrollBar.increase()
Connections {
target: ServersModel
function onDefaultServerIndexChanged(serverIndex) {
@ -348,7 +332,6 @@ PageType {
}
clip: true
interactive: false
delegate: Item {
id: menuContentDelegate
@ -368,6 +351,7 @@ PageType {
spacing: 0
RowLayout {
Layout.fillWidth: true
VerticalRadioButton {
id: serverRadioButton
@ -426,6 +410,4 @@ PageType {
}
}
}
}
}
}