QML ui fixes
This commit is contained in:
parent
1f97dd0111
commit
377bac67be
2 changed files with 34 additions and 33 deletions
|
@ -17,12 +17,12 @@ PageBase {
|
||||||
Caption {
|
Caption {
|
||||||
id: caption
|
id: caption
|
||||||
text: qsTr("Servers list")
|
text: qsTr("Servers list")
|
||||||
|
width: undefined
|
||||||
}
|
}
|
||||||
ImageButtonType {
|
ImageButtonType {
|
||||||
x: 240
|
anchors.bottom: caption.bottom
|
||||||
y: 39
|
|
||||||
anchors.left: caption.right
|
|
||||||
anchors.leftMargin: 10
|
anchors.leftMargin: 10
|
||||||
|
anchors.left: caption.right
|
||||||
width: 24
|
width: 24
|
||||||
height: 24
|
height: 24
|
||||||
icon.source: "qrc:/images/plus.png"
|
icon.source: "qrc:/images/plus.png"
|
||||||
|
@ -33,14 +33,17 @@ PageBase {
|
||||||
ListView {
|
ListView {
|
||||||
id: listWidget_servers
|
id: listWidget_servers
|
||||||
x: 20
|
x: 20
|
||||||
y: 90
|
anchors.top: caption.bottom
|
||||||
width: 340
|
anchors.topMargin: 15
|
||||||
height: 501
|
width: parent.width
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.bottomMargin: 20
|
||||||
model: ServerListLogic.serverListModel
|
model: ServerListLogic.serverListModel
|
||||||
spacing: 5
|
spacing: 5
|
||||||
|
clip: true
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
height: 60
|
height: 60
|
||||||
width: 341
|
width: root.width - 40
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: ms
|
id: ms
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -113,7 +116,7 @@ PageBase {
|
||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
ImageButtonType {
|
ImageButtonType {
|
||||||
x: 300
|
x: parent.width - 30
|
||||||
y: 25
|
y: 25
|
||||||
width: 24
|
width: 24
|
||||||
height: 24
|
height: 24
|
||||||
|
@ -128,14 +131,13 @@ PageBase {
|
||||||
}
|
}
|
||||||
ImageButtonType {
|
ImageButtonType {
|
||||||
id: pushButtonSetting
|
id: pushButtonSetting
|
||||||
x: 260
|
x: parent.width - 60
|
||||||
y: 25
|
y: 25
|
||||||
width: 24
|
width: 24
|
||||||
height: 24
|
height: 24
|
||||||
icon.source: "qrc:/images/settings.png"
|
icon.source: "qrc:/images/settings.png"
|
||||||
onClicked: {
|
opacity: 0
|
||||||
ServerListLogic.onServerListPushbuttonSettingsClicked(index)
|
|
||||||
}
|
|
||||||
OpacityAnimator {
|
OpacityAnimator {
|
||||||
id: mouseEnterAni
|
id: mouseEnterAni
|
||||||
target: pushButtonSetting;
|
target: pushButtonSetting;
|
||||||
|
@ -154,6 +156,25 @@ PageBase {
|
||||||
running: false
|
running: false
|
||||||
easing.type: Easing.InOutQuad
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,35 +152,15 @@ Window {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
focus: true
|
focus: true
|
||||||
|
|
||||||
// initialItem: page_servers
|
|
||||||
onCurrentItemChanged: {
|
onCurrentItemChanged: {
|
||||||
console.debug("QML onCurrentItemChanged " + pageLoader.currentItem)
|
console.debug("QML onCurrentItemChanged " + pageLoader.currentItem)
|
||||||
UiLogic.currentPageValue = currentItem.page
|
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: {
|
Keys.onPressed: {
|
||||||
UiLogic.keyPressEvent(event.key)
|
UiLogic.keyPressEvent(event.key)
|
||||||
|
event.accepted = true
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FolderListModel {
|
FolderListModel {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue