qml: styling server/proxy config
This commit is contained in:
@@ -23,31 +23,39 @@ ElDialog {
|
|||||||
color: "#aa000000"
|
color: "#aa000000"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
padding: 0
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: layout
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
ProxyConfig {
|
ProxyConfig {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.leftMargin: constants.paddingLarge
|
||||||
|
Layout.rightMargin: constants.paddingLarge
|
||||||
id: proxyconfig
|
id: proxyconfig
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
Button {
|
FlatButton {
|
||||||
text: qsTr('Ok')
|
Layout.fillWidth: true
|
||||||
onClicked: {
|
text: qsTr('Ok')
|
||||||
var proxy = proxyconfig.toProxyDict()
|
icon.source: '../../icons/confirmed.png'
|
||||||
if (proxy && proxy['enabled'] == true) {
|
onClicked: {
|
||||||
Network.proxy = proxy
|
var proxy = proxyconfig.toProxyDict()
|
||||||
} else {
|
if (proxy && proxy['enabled'] == true) {
|
||||||
Network.proxy = {'enabled': false}
|
Network.proxy = proxy
|
||||||
}
|
} else {
|
||||||
rootItem.close()
|
Network.proxy = {'enabled': false}
|
||||||
}
|
}
|
||||||
|
rootItem.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
var p = Network.proxy
|
var p = Network.proxy
|
||||||
console.log(JSON.stringify(p))
|
console.log(JSON.stringify(p))
|
||||||
|
|||||||
@@ -23,25 +23,32 @@ ElDialog {
|
|||||||
color: "#aa000000"
|
color: "#aa000000"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
padding: 0
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: layout
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
ServerConfig {
|
ServerConfig {
|
||||||
id: serverconfig
|
id: serverconfig
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.leftMargin: constants.paddingLarge
|
||||||
|
Layout.rightMargin: constants.paddingLarge
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
Button {
|
FlatButton {
|
||||||
text: qsTr('Ok')
|
Layout.fillWidth: true
|
||||||
onClicked: {
|
text: qsTr('Ok')
|
||||||
Config.autoConnect = serverconfig.auto_server
|
icon.source: '../../icons/confirmed.png'
|
||||||
if (!serverconfig.auto_server) {
|
onClicked: {
|
||||||
Network.server = serverconfig.address
|
Config.autoConnect = serverconfig.auto_server
|
||||||
}
|
if (!serverconfig.auto_server) {
|
||||||
rootItem.close()
|
Network.server = serverconfig.address
|
||||||
}
|
}
|
||||||
|
rootItem.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user