QML ui fixes

This commit is contained in:
pokamest 2021-10-21 18:10:28 +03:00
parent 1f97dd0111
commit 377bac67be
2 changed files with 34 additions and 33 deletions

View file

@ -17,12 +17,12 @@ PageBase {
Caption {
id: caption
text: qsTr("Servers list")
width: undefined
}
ImageButtonType {
x: 240
y: 39
anchors.left: caption.right
anchors.bottom: caption.bottom
anchors.leftMargin: 10
anchors.left: caption.right
width: 24
height: 24
icon.source: "qrc:/images/plus.png"
@ -33,14 +33,17 @@ PageBase {
ListView {
id: listWidget_servers
x: 20
y: 90
width: 340
height: 501
anchors.top: caption.bottom
anchors.topMargin: 15
width: parent.width
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
model: ServerListLogic.serverListModel
spacing: 5
clip: true
delegate: Item {
height: 60
width: 341
width: root.width - 40
MouseArea {
id: ms
anchors.fill: parent
@ -113,7 +116,7 @@ PageBase {
visible: false
}
ImageButtonType {
x: 300
x: parent.width - 30
y: 25
width: 24
height: 24
@ -128,14 +131,13 @@ PageBase {
}
ImageButtonType {
id: pushButtonSetting
x: 260
x: parent.width - 60
y: 25
width: 24
height: 24
icon.source: "qrc:/images/settings.png"
onClicked: {
ServerListLogic.onServerListPushbuttonSettingsClicked(index)
}
opacity: 0
OpacityAnimator {
id: mouseEnterAni
target: pushButtonSetting;
@ -154,6 +156,25 @@ PageBase {
running: false
easing.type: Easing.InOutQuad
}
MouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
hoverEnabled: true
propagateComposedEvents: true
onEntered: {
mouseExitAni.stop()
mouseEnterAni.start()
}
onExited: {
mouseEnterAni.stop()
mouseExitAni.start()
}
onClicked: {
ServerListLogic.onServerListPushbuttonSettingsClicked(index)
}
}
}
}
}

View file

@ -152,35 +152,15 @@ Window {
anchors.fill: parent
focus: true
// initialItem: page_servers
onCurrentItemChanged: {
console.debug("QML onCurrentItemChanged " + pageLoader.currentItem)
UiLogic.currentPageValue = currentItem.page
}
// Keys.onReleased: {
// if (event.key === Qt.Key_Back || event.key === Qt.Key_Escape) {
// console.debug("Back button captured")
// if (UiLogic.currentPageValue !== PageEnum.VPN &&
// UiLogic.currentPageValue !== PageEnum.ServerConfiguring &&
// !(UiLogic.currentPageValue === PageEnum.Start && pageLoader.depth < 2)) {
// close_page();
// }
// // TODO: fix
// //if (ui->stackedWidget_main->currentWidget()->isEnabled()) {
// // closePage();
// //}
// event.accepted = true
// }
// }
Keys.onPressed: {
UiLogic.keyPressEvent(event.key)
event.accepted = true
}
}
FolderListModel {