mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
fixed recursive rearrange on PageHome
This commit is contained in:
@@ -89,12 +89,12 @@ RadioButton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
contentItem: Item {
|
contentItem: Item {
|
||||||
implicitWidth: content.implicitWidth
|
anchors.left: parent.left
|
||||||
implicitHeight: content.implicitHeight
|
anchors.right: parent.right
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.leftMargin: 8 + background.width
|
anchors.leftMargin: 8 + background.width
|
||||||
|
|
||||||
|
implicitHeight: content.implicitHeight
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: content
|
id: content
|
||||||
|
|
||||||
|
|||||||
@@ -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 {
|
ButtonGroup {
|
||||||
id: serversRadioButtonGroup
|
id: serversRadioButtonGroup
|
||||||
@@ -334,12 +306,24 @@ PageType {
|
|||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: serversMenuContent
|
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
|
model: ServersModel
|
||||||
currentIndex: ServersModel.defaultIndex
|
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 {
|
Connections {
|
||||||
target: ServersModel
|
target: ServersModel
|
||||||
function onDefaultServerIndexChanged(serverIndex) {
|
function onDefaultServerIndexChanged(serverIndex) {
|
||||||
@@ -348,7 +332,6 @@ PageType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
interactive: false
|
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
id: menuContentDelegate
|
id: menuContentDelegate
|
||||||
@@ -368,6 +351,7 @@ PageType {
|
|||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
Layout.fillWidth: true
|
||||||
VerticalRadioButton {
|
VerticalRadioButton {
|
||||||
id: serverRadioButton
|
id: serverRadioButton
|
||||||
|
|
||||||
@@ -427,5 +411,3 @@ PageType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user