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