added scroll on page with services list
This commit is contained in:
parent
aa871bd1c9
commit
74169ef7b3
3 changed files with 66 additions and 61 deletions
|
|
@ -145,6 +145,7 @@ Button {
|
||||||
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
enabled: root.enabled
|
||||||
|
|
||||||
onEntered: {
|
onEntered: {
|
||||||
backgroundRect.color = root.hoveredColor
|
backgroundRect.color = root.hoveredColor
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,8 @@ PageType {
|
||||||
|
|
||||||
defaultActiveFocusItem: focusItem
|
defaultActiveFocusItem: focusItem
|
||||||
|
|
||||||
FlickableType {
|
|
||||||
id: fl
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
contentHeight: content.height
|
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: content
|
id: header
|
||||||
|
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|
@ -47,32 +41,43 @@ PageType {
|
||||||
Layout.topMargin: 8
|
Layout.topMargin: 8
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
Layout.bottomMargin: 32
|
Layout.bottomMargin: 16
|
||||||
|
|
||||||
headerText: qsTr("VPN by Amnezia")
|
headerText: qsTr("VPN by Amnezia")
|
||||||
descriptionText: qsTr("Choose a VPN service that suits your needs.")
|
descriptionText: qsTr("Choose a VPN service that suits your needs.")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: containers
|
id: servicesListView
|
||||||
width: parent.width
|
anchors.top: header.bottom
|
||||||
height: containers.contentItem.height
|
anchors.right: parent.right
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.topMargin: 16
|
||||||
|
anchors.bottomMargin: 16
|
||||||
spacing: 16
|
spacing: 16
|
||||||
|
|
||||||
currentIndex: 1
|
currentIndex: 1
|
||||||
interactive: false
|
clip: true
|
||||||
model: ApiServicesModel
|
model: ApiServicesModel
|
||||||
|
|
||||||
|
ScrollBar.vertical: ScrollBar {
|
||||||
|
id: scrollBar
|
||||||
|
policy: servicesListView.height >= servicesListView.contentHeight ? ScrollBar.AlwaysOff : ScrollBar.AlwaysOn
|
||||||
|
}
|
||||||
|
|
||||||
|
Keys.onUpPressed: scrollBar.decrease()
|
||||||
|
Keys.onDownPressed: scrollBar.increase()
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
implicitWidth: containers.width
|
implicitWidth: servicesListView.width
|
||||||
implicitHeight: delegateContent.implicitHeight
|
implicitHeight: delegateContent.implicitHeight
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: delegateContent
|
id: delegateContent
|
||||||
|
|
||||||
anchors.top: parent.top
|
anchors.fill: parent
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
|
|
||||||
CardWithIconsType {
|
CardWithIconsType {
|
||||||
id: card
|
id: card
|
||||||
|
|
@ -87,6 +92,8 @@ PageType {
|
||||||
|
|
||||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||||
|
|
||||||
|
enabled: isServiceAvailable
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (isServiceAvailable) {
|
if (isServiceAvailable) {
|
||||||
ApiServicesModel.setServiceIndex(index)
|
ApiServicesModel.setServiceIndex(index)
|
||||||
|
|
@ -97,6 +104,4 @@ PageType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,6 @@ PageType {
|
||||||
KeyNavigation.tab: textKey.textField
|
KeyNavigation.tab: textKey.textField
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HeaderType {
|
HeaderType {
|
||||||
property bool isVisible: SettingsController.getInstallationUuid() !== "" || PageController.isStartPageVisible()
|
property bool isVisible: SettingsController.getInstallationUuid() !== "" || PageController.isStartPageVisible()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue