update pages

This commit is contained in:
Cyril Anisimov 2024-09-29 23:54:04 +02:00
parent 3c655d0051
commit 75f189e256
13 changed files with 443 additions and 668 deletions

View file

@ -17,8 +17,6 @@ ListView {
property var rootWidth
property var selectedText
property bool a: true
width: rootWidth
height: contentItem.height // TODO: It should be fixed size, not content item height
@ -30,28 +28,34 @@ ListView {
// property int currentFocusIndex: 0
snapMode: ListView.SnapToItem
// snapMode: ListView.SnapToItem
// ScrollBar.vertical: ScrollBar {}
property bool isFocusable: true
Keys.onTabPressed: {
console.debug("--> Tab is pressed on HomeContainersListView: ", objectName)
FocusController.nextKeyTabItem()
}
Keys.onBacktabPressed: {
console.debug("--> Shift+Tab is pressed on HomeContainersListView: ", objectName)
FocusController.previousKeyTabItem()
}
Keys.onRightPressed: {
FocusController.nextKeyTabItem()
Keys.onUpPressed: {
FocusController.nextKeyUpItem()
}
Keys.onDownPressed: {
FocusController.nextKeyDownItem()
}
Keys.onLeftPressed: {
FocusController.previousKeyTabItem()
FocusController.nextKeyLeftItem()
}
Keys.onRightPressed: {
FocusController.nextKeyRightItem()
}
// activeFocusOnTab: true

View file

@ -69,6 +69,8 @@ DrawerType2 {
clip: true
interactive: true
property bool isFocusable: true
model: SortFilterProxyModel {
id: proxyInstalledAppsModel
sourceModel: installedAppsModel

View file

@ -33,43 +33,7 @@ ListView {
policy: root.height >= root.contentHeight ? ScrollBar.AlwaysOff : ScrollBar.AlwaysOn
}
readonly property bool isFocusable: true
// Keys.onTabPressed: {
// FocusController.nextKeyTabItem()
// }
// activeFocusOnTab: true
// focus: true
property int focusItemIndex: 0
// onFocusItemIndexChanged: {
// console.debug("===>> root onFocusItemIndexChanged")
// // const focusedElement = root.itemAtIndex(focusItemIndex)
// // if (focusedElement) {
// // if (focusedElement.y + focusedElement.height > root.height) {
// // root.contentY = focusedElement.y + focusedElement.height - root.height
// // } else {
// // root.contentY = 0
// // }
// // }
// }
Keys.onUpPressed: scrollBar.decrease()
Keys.onDownPressed: scrollBar.increase()
// Connections {
// target: drawer
// enabled: !GC.isMobile()
// function onIsCollapsedChanged() {
// if (drawer.isCollapsedStateActive) {
// const item = root.itemAtIndex(root.focusItemIndex)
// if (item) { item.serverRadioButtonProperty.focus = false }
// }
// }
// }
property bool isFocusable: true
Connections {
target: ServersModel
@ -135,7 +99,6 @@ ListView {
enabled: false
}
// Keys.onTabPressed: serverInfoButton.forceActiveFocus()
Keys.onEnterPressed: serverRadioButton.clicked()
Keys.onReturnPressed: serverRadioButton.clicked()
}
@ -144,10 +107,6 @@ ListView {
id: serverInfoButton
objectName: "serverInfoButton"
// signal keyTabOnLastElement
// isFocusable: false
image: "qrc:/images/controls/settings.svg"
imageColor: AmneziaStyle.color.paleGray
@ -156,41 +115,10 @@ ListView {
z: 1
// onActiveFocusChanged: {
// console.debug("===>> serverInfoButton::activeFocusChanged")
// if (activeFocus) {
// if (currentIndex === root.count - 1) {
// console.log("---> Latest element")
// keyTabOnLastElement()
// }
// console.log("--->>", currentIndex)
// // serverRadioButton.forceActiveFocus()
// }
// }
// onKeyTabOnLastElement: {
// console.log("*** Signal emmited! ***")
// FocusController.nextKeyTabItem()
// }
// Keys.onTabPressed: {
// console.log("===>> serverInfoButton::Keys.onTabPressed")
// if (root.focusItemIndex < root.count - 1) {
// root.focusItemIndex++
// root.itemAtIndex(root.focusItemIndex).forceActiveFocus()
// } else {
// FocusController.nextKeyTabItem()
// root.contentY = 0
// }
// }
Keys.onEnterPressed: serverInfoButton.clicked()
Keys.onReturnPressed: serverInfoButton.clicked()
onClicked: function() {
console.debug("===>> onClicked serverInfoButton")
ServersModel.processedIndex = index
PageController.goToPage(PageEnum.PageSettingsServerInfo)
drawer.closeTriggered()

View file

@ -22,28 +22,7 @@ ListView {
clip: true
interactive: false
activeFocusOnTab: true
// Keys.onTabPressed: {
// if (currentIndex < this.count - 1) {
// this.incrementCurrentIndex()
// } else {
// currentIndex = 0
// lastItemTabClickedSignal()
// }
// }
onCurrentIndexChanged: {
if (visible) {
if (fl.contentHeight > fl.height) {
var item = this.currentItem
if (item.y < fl.height) {
fl.contentY = item.y
} else if (item.y + item.height > fl.contentY + fl.height) {
fl.contentY = item.y + item.height - fl.height
}
}
}
}
property bool isFocusable: false
onVisibleChanged: {
if (visible) {
@ -55,12 +34,6 @@ ListView {
implicitWidth: root.width
implicitHeight: delegateContent.implicitHeight
onActiveFocusChanged: {
if (activeFocus) {
containerRadioButton.rightButton.forceActiveFocus()
}
}
ColumnLayout {
id: delegateContent

View file

@ -54,20 +54,25 @@ Item {
FocusController.nextKeyTabItem()
}
// function popupClosedFunc() {
// if (!GC.isMobile()) {
// this.forceActiveFocus()
// }
// }
Keys.onBacktabPressed: {
FocusController.previousKeyTabItem()
}
// property var parentFlickable
// onFocusChanged: {
// if (root.activeFocus) {
// if (root.parentFlickable) {
// root.parentFlickable.ensureVisible(root)
// }
// }
// }
Keys.onUpPressed: {
FocusController.nextKeyUpItem()
}
Keys.onDownPressed: {
FocusController.nextKeyDownItem()
}
Keys.onLeftPressed: {
FocusController.nextKeyLeftItem()
}
Keys.onRightPressed: {
FocusController.nextKeyRightItem()
}
implicitWidth: rootButtonContent.implicitWidth
implicitHeight: rootButtonContent.implicitHeight
@ -171,8 +176,6 @@ Item {
}
ImageButtonType {
// isFocusable: false
Layout.rightMargin: 16
implicitWidth: 40
@ -206,10 +209,6 @@ Item {
anchors.fill: parent
expandedHeight: drawerParent.height * drawerHeight
// onClosed: {
// root.popupClosedFunc()
// }
expandedStateContent: Item {
id: container
implicitHeight: menu.expandedHeight
@ -226,7 +225,11 @@ Item {
id: backButton
backButtonImage: root.headerBackButtonImage
backButtonFunction: function() { menu.closeTriggered() }
// KeyNavigation.tab: listViewLoader.item
onActiveFocusChanged: {
if(activeFocus) {
root.listView.positionViewAtBeginning()
}
}
}
}
@ -252,14 +255,6 @@ Item {
Loader {
id: listViewLoader
sourceComponent: root.listView
onLoaded: {
// listViewLoader.item.parentFlickable = flickable
// FocusController.reload()
// listViewLoader.item.lastItemTabClicked = function() {
// focusItem.forceActiveFocus()
// }
}
}
}
}

View file

@ -26,12 +26,6 @@ ListView {
height: root.contentItem.height
clip: true
interactive: false
property FlickableType parentFlickable
property var lastItemTabClicked
property int currentFocusIndex: 0
property bool isFocusable: true
@ -69,14 +63,11 @@ ListView {
radioButton.clicked()
}
delegate: Item {
implicitWidth: rootWidth
implicitHeight: content.implicitHeight
ColumnLayout {
delegate: ColumnLayout {
id: content
anchors.fill: parent
implicitWidth: rootWidth
// implicitHeight: content.implicitHeight
RadioButton {
id: radioButton
@ -149,7 +140,6 @@ ListView {
}
}
}
}
Component.onCompleted: {
if (root.currentIndex === index) {

View file

@ -126,7 +126,6 @@ PageType {
onClosed: {
console.log(objectName, " was closed...")
FocusController.setRootItem(null)
}
}
}
@ -257,7 +256,6 @@ PageType {
console.debug("onClicked collapsedButtonChevron")
if (drawer.isCollapsedStateActive()) {
drawer.openTriggered()
FocusController.setRootItem(drawer)
}
}
}
@ -340,6 +338,8 @@ PageType {
rootButtonTextTopMargin: 8
rootButtonTextBottomMargin: 8
enabled: drawer.isOpened
text: ServersModel.defaultServerDefaultContainerName
textColor: AmneziaStyle.color.midnightBlack
headerText: qsTr("VPN protocol")
@ -358,8 +358,6 @@ PageType {
rootWidth: root.width
height: 500 // TODO: make calculated
// isFocusable: false // TODO: this is a workaround. Need to remove it
Connections {
objectName: "rowLayoutConnections"

View file

@ -31,14 +31,11 @@ PageType {
id: containersRadioButtonGroup
}
delegate: Item {
implicitWidth: parent.width
implicitHeight: content.implicitHeight
ColumnLayout {
delegate: ColumnLayout {
id: content
anchors.fill: parent
implicitWidth: parent.width
implicitHeight: content.implicitHeight
RowLayout {
VerticalRadioButton {
@ -99,5 +96,4 @@ PageType {
}
}
}
}
}

View file

@ -19,24 +19,26 @@ import "../Components"
PageType {
id: root
property int pageSettingsServerProtocols: 0
property int pageSettingsServerServices: 1
property int pageSettingsServerData: 2
property int pageSettingsApiServerInfo: 3
property int pageSettingsApiLanguageList: 4
readonly property int pageSettingsServerProtocols: 0
readonly property int pageSettingsServerServices: 1
readonly property int pageSettingsServerData: 2
readonly property int pageSettingsApiServerInfo: 3
readonly property int pageSettingsApiLanguageList: 4
// defaultActiveFocusItem: focusItem
property var server
Connections {
target: PageController
function onGoToPageSettingsServerServices() {
tabBar.currentIndex = root.pageSettingsServerServices
tabBar.setCurrentIndex(root.pageSettingsServerServices)
}
}
SortFilterProxyModel {
id: proxyServersModel
objectName: "proxyServersModel"
sourceModel: ServersModel
filters: [
ValueFilter {
@ -44,36 +46,27 @@ PageType {
value: true
}
]
Component.onCompleted: {
root.server = proxyServersModel.get(0)
}
}
ColumnLayout {
objectName: "mainLayout"
anchors.fill: parent
anchors.topMargin: 20
spacing: 16
Repeater {
id: header
model: proxyServersModel
activeFocusOnTab: true
onFocusChanged: {
header.itemAt(0).focusItem.forceActiveFocus()
}
delegate: ColumnLayout {
property alias focusItem: backButton
id: content
Layout.topMargin: 20
spacing: 4
BackButtonType {
id: backButton
objectName: "backButton"
backButtonFunction: function() {
if (nestedStackView.currentIndex === root.pageSettingsApiServerInfo &&
ServersModel.getProcessedServerData("isCountrySelectionAvailable")) {
if (nestedStackView.currentIndex === root.pageSettingsApiServerInfo
&& ServersModel.getProcessedServerData("isCountrySelectionAvailable")) {
nestedStackView.currentIndex = root.pageSettingsApiLanguageList
} else {
PageController.closePage()
@ -83,22 +76,25 @@ PageType {
HeaderType {
id: headerContent
objectName: "headerContent"
Layout.fillWidth: true
Layout.leftMargin: 16
Layout.rightMargin: 16
Layout.bottomMargin: 10
actionButtonImage: nestedStackView.currentIndex === root.pageSettingsApiLanguageList ? "qrc:/images/controls/settings.svg" : "qrc:/images/controls/edit-3.svg"
headerText: name
headerText: root.server.name
descriptionText: {
if (ServersModel.getProcessedServerData("isServerFromGatewayApi")) {
return ApiServicesModel.getSelectedServiceData("serviceDescription")
} else if (ServersModel.getProcessedServerData("isServerFromTelegramApi")) {
return serverDescription
return root.server.serverDescription
} else if (ServersModel.isProcessedServerHasWriteAccess()) {
return credentialsLogin + " · " + hostName
return root.server.credentialsLogin + " · " + root.server.hostName
} else {
return hostName
return root.server.hostName
}
}
@ -113,18 +109,13 @@ PageType {
DrawerType2 {
id: serverNameEditDrawer
objectName: "serverNameEditDrawer"
parent: root
anchors.fill: parent
expandedHeight: root.height * 0.35
onClosed: {
if (!GC.isMobile()) {
headerContent.actionButton.forceActiveFocus()
}
}
expandedStateContent: ColumnLayout {
anchors.top: parent.top
anchors.left: parent.left
@ -133,20 +124,12 @@ PageType {
anchors.leftMargin: 16
anchors.rightMargin: 16
Connections {
target: serverNameEditDrawer
enabled: !GC.isMobile()
function onOpened() {
serverName.textField.forceActiveFocus()
}
}
TextFieldWithHeaderType {
id: serverName
Layout.fillWidth: true
headerText: qsTr("Server name")
textFieldText: name
textFieldText: root.server.name
textField.maximumLength: 30
checkEmptyText: true
}
@ -163,16 +146,14 @@ PageType {
return
}
if (serverName.textFieldText !== name) {
name = serverName.textFieldText
if (serverName.textFieldText !== root.server.name) {
root.server.name = serverName.textFieldText // TODO(CyAn84): set value to the model
}
serverNameEditDrawer.closeTriggered()
}
}
}
}
}
}
TabBar {
id: tabBar
@ -189,33 +170,27 @@ PageType {
visible: !ServersModel.getProcessedServerData("isServerFromGatewayApi")
activeFocusOnTab: true
onFocusChanged: {
if (activeFocus) {
protocolsTab.forceActiveFocus()
}
}
TabButtonType {
id: protocolsTab
visible: protocolsPage.installedProtocolsCount
width: protocolsPage.installedProtocolsCount ? undefined : 0
isSelected: tabBar.currentIndex === root.pageSettingsServerProtocols
isSelected: TabBar.tabBar.currentIndex === root.pageSettingsServerProtocols
text: qsTr("Protocols")
Keys.onReturnPressed: tabBar.currentIndex = root.pageSettingsServerProtocols
Keys.onEnterPressed: tabBar.currentIndex = root.pageSettingsServerProtocols
Keys.onReturnPressed: TabBar.tabBar.setCurrentIndex(root.pageSettingsServerProtocols)
Keys.onEnterPressed: TabBar.tabBar.setCurrentIndex(root.pageSettingsServerProtocols)
}
TabButtonType {
id: servicesTab
visible: servicesPage.installedServicesCount
width: servicesPage.installedServicesCount ? undefined : 0
isSelected: tabBar.currentIndex === root.pageSettingsServerServices
isSelected: TabBar.tabBar.currentIndex === root.pageSettingsServerServices
text: qsTr("Services")
Keys.onReturnPressed: tabBar.currentIndex = root.pageSettingsServerServices
Keys.onEnterPressed: tabBar.currentIndex = root.pageSettingsServerServices
Keys.onReturnPressed: TabBar.tabBar.setCurrentIndex(root.pageSettingsServerServices)
Keys.onEnterPressed: TabBar.tabBar.setCurrentIndex(root.pageSettingsServerServices)
}
TabButtonType {
@ -223,24 +198,15 @@ PageType {
isSelected: tabBar.currentIndex === root.pageSettingsServerData
text: qsTr("Management")
Keys.onReturnPressed: tabBar.currentIndex = root.pageSettingsServerData
Keys.onEnterPressed: tabBar.currentIndex = root.pageSettingsServerData
Keys.onTabPressed: function() {
if (nestedStackView.currentIndex === root.pageSettingsServerProtocols) {
return protocolsPage
} else if (nestedStackView.currentIndex === root.pageSettingsServerProtocols) {
return servicesPage
} else {
return dataPage
}
}
Keys.onReturnPressed: TabBar.tabBar.setCurrentIndex(root.pageSettingsServerData)
Keys.onEnterPressed: TabBar.tabBar.setCurrentIndex(root.pageSettingsServerData)
}
}
StackLayout {
id: nestedStackView
Layout.preferredWidth: root.width
Layout.preferredHeight: root.height - tabBar.implicitHeight - header.implicitHeight
Layout.fillWidth: true
currentIndex: ServersModel.getProcessedServerData("isServerFromGatewayApi") ?
(ServersModel.getProcessedServerData("isCountrySelectionAvailable") ?
@ -249,36 +215,26 @@ PageType {
PageSettingsServerProtocols {
id: protocolsPage
stackView: root.stackView
onLastItemTabClickedSignal: lastItemTabClicked(focusItem)
}
PageSettingsServerServices {
id: servicesPage
stackView: root.stackView
onLastItemTabClickedSignal: lastItemTabClicked(focusItem)
}
PageSettingsServerData {
id: dataPage
stackView: root.stackView
onLastItemTabClickedSignal: lastItemTabClicked(focusItem)
}
PageSettingsApiServerInfo {
id: apiInfoPage
stackView: root.stackView
// onLastItemTabClickedSignal: lastItemTabClicked(focusItem)
}
PageSettingsApiLanguageList {
id: apiLanguageListPage
stackView: root.stackView
// onLastItemTabClickedSignal: lastItemTabClicked(focusItem)
}
}

View file

@ -21,25 +21,15 @@ PageType {
property var installedProtocolsCount
onFocusChanged: settingsContainersListView.forceActiveFocus()
signal lastItemTabClickedSignal()
FlickableType {
id: fl
anchors.top: parent.top
anchors.bottom: parent.bottom
contentHeight: content.implicitHeight
Column {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
function resetView() {
settingsContainersListView.positionViewAtBeginning()
}
SettingsContainersListView {
id: settingsContainersListView
anchors.fill: parent
Connections {
target: ServersModel
@ -66,8 +56,10 @@ PageType {
]
}
Component.onCompleted: updateContainersModelFilters()
}
Component.onCompleted: {
settingsContainersListView.isFocusable = true
settingsContainersListView.interactive = true
updateContainersModelFilters()
}
}
}

View file

@ -21,25 +21,11 @@ PageType {
property var installedServicesCount
onFocusChanged: settingsContainersListView.forceActiveFocus()
signal lastItemTabClickedSignal()
FlickableType {
id: fl
anchors.top: parent.top
anchors.bottom: parent.bottom
contentHeight: content.implicitHeight
Column {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
SettingsContainersListView {
id: settingsContainersListView
anchors.fill: parent
Connections {
target: ServersModel
@ -65,8 +51,10 @@ PageType {
]
}
Component.onCompleted: updateContainersModelFilters()
}
Component.onCompleted: {
settingsContainersListView.isFocusable = true
settingsContainersListView.interactive = true
updateContainersModelFilters()
}
}
}

View file

@ -169,33 +169,45 @@ PageType {
}
}
}
// KeyNavigation.tab: {
// return sites.count > 0 ?
// sites :
// searchField.textField
// }
}
}
FlickableType {
id: fl
anchors.top: header.bottom
anchors.topMargin: 16
contentHeight: col.implicitHeight + addSiteButton.implicitHeight + addSiteButton.anchors.bottomMargin + addSiteButton.anchors.topMargin
enabled: root.pageEnabled
Column {
id: col
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
ListView {
id: sites
anchors.top: header.bottom
anchors.topMargin: 16
width: parent.width
height: sites.contentItem.height
height: 200 // TODO: Change to correct height
enabled: root.pageEnabled
property bool isFocusable: true
Keys.onTabPressed: {
FocusController.nextKeyTabItem()
}
Keys.onBacktabPressed: {
FocusController.previousKeyTabItem()
}
Keys.onUpPressed: {
FocusController.nextKeyUpItem()
}
Keys.onDownPressed: {
FocusController.nextKeyDownItem()
}
Keys.onLeftPressed: {
FocusController.nextKeyLeftItem()
}
Keys.onRightPressed: {
FocusController.nextKeyRightItem()
}
model: SortFilterProxyModel {
id: proxySitesModel
@ -217,30 +229,16 @@ PageType {
}
clip: true
interactive: false
activeFocusOnTab: true
focus: true
Keys.onTabPressed: {
if (currentIndex < this.count - 1) {
this.incrementCurrentIndex()
} else {
currentIndex = 0
searchField.textField.forceActiveFocus()
}
fl.ensureVisible(currentItem)
}
delegate: Item {
implicitWidth: sites.width
implicitHeight: delegateContent.implicitHeight
onActiveFocusChanged: {
if (activeFocus) {
site.rightButton.forceActiveFocus()
}
}
// onActiveFocusChanged: {
// if (activeFocus) {
// site.rightButton.forceActiveFocus()
// }
// }
ColumnLayout {
id: delegateContent
@ -284,8 +282,6 @@ PageType {
}
}
}
}
Rectangle {
anchors.fill: addSiteButton
@ -315,7 +311,6 @@ PageType {
textFieldPlaceholderText: qsTr("website or IP")
buttonImageSource: "qrc:/images/controls/plus.svg"
// KeyNavigation.tab: GC.isMobile() ? focusItem : addSiteButtonImage
clickedFunc: function() {
PageController.showBusyIndicator(true)
@ -339,8 +334,6 @@ PageType {
Keys.onReturnPressed: addSiteButtonImage.clicked()
Keys.onEnterPressed: addSiteButtonImage.clicked()
Keys.onTabPressed: lastItemTabClicked(focusItem)
}
}
@ -350,12 +343,6 @@ PageType {
anchors.fill: parent
expandedHeight: parent.height * 0.4375
onClosed: {
// if (root.defaultActiveFocusItem && !GC.isMobile()) {
// root.defaultActiveFocusItem.forceActiveFocus()
// }
}
expandedStateContent: ColumnLayout {
id: moreActionsDrawerContent
@ -363,20 +350,6 @@ PageType {
anchors.left: parent.left
anchors.right: parent.right
Connections {
target: moreActionsDrawer
function onOpened() {
focusItem1.forceActiveFocus()
}
function onActiveFocusChanged() {
if (!GC.isMobile()) {
focusItem1.forceActiveFocus()
}
}
}
Header2Type {
Layout.fillWidth: true
Layout.margins: 16
@ -433,23 +406,9 @@ PageType {
anchors.fill: parent
expandedHeight: parent.height * 0.4375
onClosed: {
if (!GC.isMobile()) {
moreActionsDrawer.forceActiveFocus()
}
}
expandedStateContent: Item {
implicitHeight: importSitesDrawer.expandedHeight
Connections {
target: importSitesDrawer
enabled: !GC.isMobile()
function onOpened() {
focusItem2.forceActiveFocus()
}
}
BackButtonType {
id: importSitesDrawerBackButton

View file

@ -236,11 +236,6 @@ PageType {
descriptionText: qsTr("Use for your own devices, or share with those you trust to manage the server.")
}
// Item {
// id: focusItem
// // KeyNavigation.tab: shareFullAccessButton.rightButton
// }
LabelWithButtonType {
id: shareFullAccessButton
Layout.fillWidth: true
@ -253,7 +248,6 @@ PageType {
PageController.goToPage(PageEnum.PageShareFullAccess)
shareFullAccessDrawer.closeTriggered()
}
}
}
}
@ -694,38 +688,38 @@ PageType {
}
clip: true
interactive: false
// interactive: false
activeFocusOnTab: true
focus: true
Keys.onTabPressed: {
if (!GC.isMobile()) {
if (currentIndex < this.count - 1) {
this.incrementCurrentIndex()
// currentItem.focusItem.forceActiveFocus()
} else {
this.currentIndex = 0
// lastItemTabClicked(focusItem)
}
}
}
// activeFocusOnTab: true
// focus: true
// Keys.onTabPressed: {
// if (!GC.isMobile()) {
// if (currentIndex < this.count - 1) {
// this.incrementCurrentIndex()
// // currentItem.focusItem.forceActiveFocus()
// } else {
// this.currentIndex = 0
// // lastItemTabClicked(focusItem)
// }
// }
// }
onActiveFocusChanged: {
if (focus && !GC.isMobile()) {
currentIndex = 0
// currentItem.focusItem.forceActiveFocus()
}
}
// onActiveFocusChanged: {
// if (focus && !GC.isMobile()) {
// currentIndex = 0
// // currentItem.focusItem.forceActiveFocus()
// }
// }
onCurrentIndexChanged: {
if (currentItem) {
if (currentItem.y < a.contentY) {
a.contentY = currentItem.y
} else if (currentItem.y + currentItem.height + clientsListView.y > a.contentY + a.height) {
a.contentY = currentItem.y + clientsListView.y + currentItem.height - a.height
}
}
}
// onCurrentIndexChanged: {
// if (currentItem) {
// if (currentItem.y < a.contentY) {
// a.contentY = currentItem.y
// } else if (currentItem.y + currentItem.height + clientsListView.y > a.contentY + a.height) {
// a.contentY = currentItem.y + clientsListView.y + currentItem.height - a.height
// }
// }
// }
delegate: Item {
implicitWidth: clientsListView.width