qml ui fixes
This commit is contained in:
parent
a390f2e988
commit
0d9f1ba95b
26 changed files with 168 additions and 103 deletions
|
|
@ -7,9 +7,8 @@ import "../Config"
|
|||
|
||||
Item {
|
||||
id: root
|
||||
property int page: PageEnum.Start
|
||||
property var page: PageEnum.Start
|
||||
property var logic: UiLogic
|
||||
enabled: logic.pageEnabled
|
||||
|
||||
// width: GC.screenWidth
|
||||
// height: GC.screenHeight
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Layouts 1.15
|
||||
import SortFilterProxyModel 0.2
|
||||
import PageEnum 1.0
|
||||
import "./"
|
||||
|
|
@ -82,7 +83,7 @@ PageBase {
|
|||
ListView {
|
||||
id: tb_c
|
||||
x: 10
|
||||
width: parent.width - 40
|
||||
width: parent.width - 10
|
||||
height: tb_c.contentItem.height
|
||||
currentIndex: -1
|
||||
spacing: 5
|
||||
|
|
@ -96,7 +97,7 @@ PageBase {
|
|||
Item {
|
||||
id: c_item
|
||||
width: parent.width
|
||||
height: lb_container_name.height + tb_p.height
|
||||
height: row_container.height + tb_p.height
|
||||
anchors.left: parent.left
|
||||
Rectangle {
|
||||
anchors.top: parent.top
|
||||
|
|
@ -106,47 +107,108 @@ PageBase {
|
|||
visible: index !== tb_c.currentIndex
|
||||
}
|
||||
Rectangle {
|
||||
anchors.top: lb_container_name.top
|
||||
anchors.bottom: lb_container_name.bottom
|
||||
anchors.top: row_container.top
|
||||
anchors.bottom: row_container.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
color: "#63B4FB"
|
||||
visible: index === tb_c.currentIndex
|
||||
}
|
||||
Text {
|
||||
id: lb_container_name
|
||||
text: name_role
|
||||
font.pixelSize: 17
|
||||
//font.bold: true
|
||||
color: "#100A44"
|
||||
topPadding: 5
|
||||
bottomPadding: 5
|
||||
leftPadding: 10
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.top: lb_container_name.top
|
||||
anchors.bottom: lb_container_name.bottom
|
||||
// ImageButtonType {
|
||||
// id: button_default1
|
||||
// z:10
|
||||
|
||||
// Layout.alignment: Qt.AlignRight
|
||||
// checkable: true
|
||||
// img.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
|
||||
// width: 20
|
||||
// img.width: 20
|
||||
// height: 20
|
||||
|
||||
// checked: default_role
|
||||
// onClicked: {
|
||||
// ServerContainersLogic.onPushButtonDefaultClicked(proxyContainersModel.mapToSource(index))
|
||||
// }
|
||||
// }
|
||||
|
||||
RowLayout {
|
||||
id: row_container
|
||||
//width: parent.width
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
propagateComposedEvents: true
|
||||
onClicked: {
|
||||
tb_c.currentIndex = index
|
||||
UiLogic.protocolsModel.setSelectedDockerContainer(proxyContainersModel.mapToSource(index))
|
||||
//container_selector.containerSelected(index)
|
||||
//root.close()
|
||||
|
||||
// anchors.top: lb_container_name.top
|
||||
// anchors.bottom: lb_container_name.bottom
|
||||
|
||||
Text {
|
||||
id: lb_container_name
|
||||
text: name_role
|
||||
font.pixelSize: 17
|
||||
//font.bold: true
|
||||
color: "#100A44"
|
||||
topPadding: 5
|
||||
bottomPadding: 5
|
||||
leftPadding: 10
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.WordWrap
|
||||
Layout.fillWidth: true
|
||||
|
||||
MouseArea {
|
||||
anchors.top: lb_container_name.top
|
||||
anchors.bottom: lb_container_name.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
propagateComposedEvents: true
|
||||
onClicked: {
|
||||
if (tb_c.currentIndex === index) tb_c.currentIndex = -1
|
||||
else tb_c.currentIndex = index
|
||||
|
||||
UiLogic.protocolsModel.setSelectedDockerContainer(proxyContainersModel.mapToSource(index))
|
||||
//ServerContainersLogic.setSelectedDockerContainer(proxyContainersModel.mapToSource(index))
|
||||
|
||||
//container_selector.containerSelected(index)
|
||||
//root.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
id: button_default
|
||||
|
||||
Layout.alignment: Qt.AlignRight
|
||||
checkable: true
|
||||
img.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
|
||||
implicitWidth: 30
|
||||
implicitHeight: 30
|
||||
|
||||
checked: default_role
|
||||
onClicked: {
|
||||
ServerContainersLogic.onPushButtonDefaultClicked(proxyContainersModel.mapToSource(index))
|
||||
}
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
id: button_share
|
||||
Layout.alignment: Qt.AlignRight
|
||||
icon.source: "qrc:/images/share.png"
|
||||
implicitWidth: 30
|
||||
implicitHeight: 30
|
||||
onClicked: {
|
||||
ServerContainersLogic.onPushButtonShareClicked(proxyContainersModel.mapToSource(index))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
ListView {
|
||||
id: tb_p
|
||||
currentIndex: -1
|
||||
visible: index === tb_c.currentIndex
|
||||
x: 10
|
||||
anchors.top: lb_container_name.bottom
|
||||
anchors.top: row_container.bottom
|
||||
|
||||
width: parent.width - 40
|
||||
height: visible ? tb_p.contentItem.height : 0
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ PageProtocolBase {
|
|||
y: 40
|
||||
width: 380
|
||||
height: 600
|
||||
enabled: logic.widgetProtoCloakEnabled
|
||||
enabled: logic.pageEnabled
|
||||
ComboBoxType {
|
||||
x: 190
|
||||
y: 60
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ PageProtocolBase {
|
|||
y: 40
|
||||
width: 380
|
||||
height: 600
|
||||
enabled: logic.widgetProtoOpenVpnEnabled
|
||||
enabled: logic.pageEnabled
|
||||
CheckBoxType {
|
||||
x: 30
|
||||
y: 280
|
||||
|
|
|
|||
|
|
@ -19,28 +19,32 @@ PageProtocolBase {
|
|||
y: 40
|
||||
width: 380
|
||||
height: 600
|
||||
enabled: logic.widgetProtoShadowSocksEnabled
|
||||
enabled: logic.pageEnabled
|
||||
ComboBoxType {
|
||||
x: 190
|
||||
y: 60
|
||||
width: 151
|
||||
height: 31
|
||||
model: [
|
||||
qsTr("chacha20-poly1305"),
|
||||
model: [
|
||||
qsTr("chacha20-ietf-poly1305"),
|
||||
qsTr("xchacha20-ietf-poly1305"),
|
||||
qsTr("aes-256-gcm"),
|
||||
qsTr("aes-192-gcm"),
|
||||
qsTr("aes-128-gcm")
|
||||
]
|
||||
currentIndex: {
|
||||
console.debug("logic.comboBoxProtoShadowSocksCipherText " + logic.comboBoxProtoShadowSocksCipherText)
|
||||
for (let i = 0; i < model.length; ++i) {
|
||||
console.debug("check " + model[i])
|
||||
if (logic.comboBoxProtoShadowSocksCipherText === model[i]) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
onCurrentTextChanged: {
|
||||
logic.comboBoxProtoShadowSocksCipherText = currentText
|
||||
}
|
||||
// onCurrentTextChanged: {
|
||||
// logic.comboBoxProtoShadowSocksCipherText = currentText
|
||||
// }
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@ import "../../Config"
|
|||
|
||||
PageBase {
|
||||
id: root
|
||||
property int protocol: ProtocolEnum.Any
|
||||
property var protocol: ProtocolEnum.Any
|
||||
page: PageEnum.ProtocolSettings
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue