mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-22 15:58:46 +00:00
feat(ui/views/App/Settings/SettingsNetwork): view in progress
This commit is contained in:
parent
95fb6b9694
commit
8a5bb3a56d
4 changed files with 74 additions and 19 deletions
|
|
@ -3,9 +3,9 @@ import QtQuick 2.7
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
property alias updating: actionButton.updating
|
||||||
property alias useStates: actionButton.useStates
|
property alias useStates: actionButton.useStates
|
||||||
property bool enabled: true
|
property bool enabled: true
|
||||||
property alias updating: actionButton.updating
|
|
||||||
property int iconSize // Optionnal.
|
property int iconSize // Optionnal.
|
||||||
property string icon
|
property string icon
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,19 +8,31 @@ import Common.Styles 1.0
|
||||||
Switch {
|
Switch {
|
||||||
id: control
|
id: control
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
property bool enabled: true
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
checked: false
|
checked: false
|
||||||
|
|
||||||
indicator: Rectangle {
|
indicator: Rectangle {
|
||||||
implicitHeight: SwitchStyle.indicator.height
|
implicitHeight: SwitchStyle.indicator.height
|
||||||
implicitWidth: SwitchStyle.indicator.width
|
implicitWidth: SwitchStyle.indicator.width
|
||||||
|
|
||||||
border.color: control.checked
|
border.color: control.enabled
|
||||||
? SwitchStyle.indicator.border.color.checked
|
? (
|
||||||
: SwitchStyle.indicator.border.color.normal
|
control.checked
|
||||||
|
? SwitchStyle.indicator.border.color.checked
|
||||||
|
: SwitchStyle.indicator.border.color.normal
|
||||||
|
) : SwitchStyle.indicator.border.color.disabled
|
||||||
|
|
||||||
color: control.checked
|
color: control.enabled
|
||||||
? SwitchStyle.indicator.color.checked
|
? (
|
||||||
: SwitchStyle.indicator.color.normal
|
control.checked
|
||||||
|
? SwitchStyle.indicator.color.checked
|
||||||
|
: SwitchStyle.indicator.color.normal
|
||||||
|
) : SwitchStyle.indicator.color.disabled
|
||||||
|
|
||||||
radius: SwitchStyle.indicator.radius
|
radius: SwitchStyle.indicator.radius
|
||||||
x: control.leftPadding
|
x: control.leftPadding
|
||||||
|
|
@ -33,18 +45,29 @@ Switch {
|
||||||
width: SwitchStyle.sphere.size
|
width: SwitchStyle.sphere.size
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
border.color: control.checked
|
|
||||||
? (control.down
|
|
||||||
? SwitchStyle.sphere.border.color.pressed
|
|
||||||
: SwitchStyle.sphere.border.color.checked
|
|
||||||
) : SwitchStyle.sphere.border.color.normal
|
|
||||||
|
|
||||||
color: control.down
|
border.color: control.enabled
|
||||||
? SwitchStyle.sphere.color.pressed
|
?
|
||||||
: SwitchStyle.sphere.color.normal
|
(
|
||||||
|
control.checked
|
||||||
|
? (
|
||||||
|
control.down
|
||||||
|
? SwitchStyle.sphere.border.color.pressed
|
||||||
|
: SwitchStyle.sphere.border.color.checked
|
||||||
|
) : SwitchStyle.sphere.border.color.normal
|
||||||
|
) : SwitchStyle.sphere.border.color.disabled
|
||||||
|
|
||||||
|
color: control.enabled
|
||||||
|
?
|
||||||
|
(
|
||||||
|
control.down
|
||||||
|
? SwitchStyle.sphere.color.pressed
|
||||||
|
: SwitchStyle.sphere.color.normal
|
||||||
|
) : SwitchStyle.sphere.color.disabled
|
||||||
|
|
||||||
radius: width / 2
|
radius: width / 2
|
||||||
x: control.checked ? parent.width - width : 0
|
|
||||||
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
states: State {
|
states: State {
|
||||||
when: control.checked
|
when: control.checked
|
||||||
|
|
@ -65,4 +88,12 @@ Switch {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
onClicked: control.enabled && control.toggle()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,14 @@ QtObject {
|
||||||
property QtObject border: QtObject {
|
property QtObject border: QtObject {
|
||||||
property QtObject color: QtObject {
|
property QtObject color: QtObject {
|
||||||
property color checked: Colors.i
|
property color checked: Colors.i
|
||||||
|
property color disabled: Colors.c
|
||||||
property color normal: Colors.c
|
property color normal: Colors.c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property QtObject color: QtObject {
|
property QtObject color: QtObject {
|
||||||
property color checked: Colors.i
|
property color checked: Colors.i
|
||||||
|
property color disabled: Colors.e
|
||||||
property color normal: Colors.k
|
property color normal: Colors.k
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -33,12 +35,14 @@ QtObject {
|
||||||
property QtObject border: QtObject {
|
property QtObject border: QtObject {
|
||||||
property QtObject color: QtObject {
|
property QtObject color: QtObject {
|
||||||
property color checked: Colors.i
|
property color checked: Colors.i
|
||||||
|
property color disabled: Colors.c
|
||||||
property color normal: Colors.w
|
property color normal: Colors.w
|
||||||
property color pressed: Colors.w
|
property color pressed: Colors.w
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property QtObject color: QtObject {
|
property QtObject color: QtObject {
|
||||||
|
property color disabled: Colors.e
|
||||||
property color pressed: Colors.c
|
property color pressed: Colors.c
|
||||||
property color normal: Colors.k
|
property color normal: Colors.k
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ TabContainer {
|
||||||
label: qsTr('sipUdpPortLabel')
|
label: qsTr('sipUdpPortLabel')
|
||||||
|
|
||||||
NumericField {
|
NumericField {
|
||||||
readOnly: randomSipUdpPort.checked
|
readOnly: randomSipUdpPort.checked || !enableSipUdpPort.checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -72,8 +72,14 @@ TabContainer {
|
||||||
|
|
||||||
Switch {
|
Switch {
|
||||||
id: randomSipUdpPort
|
id: randomSipUdpPort
|
||||||
|
|
||||||
|
enabled: enableSipUdpPort.checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Switch {
|
||||||
|
id: enableSipUdpPort
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FormLine {
|
FormLine {
|
||||||
|
|
@ -81,7 +87,7 @@ TabContainer {
|
||||||
label: qsTr('sipTcpPortLabel')
|
label: qsTr('sipTcpPortLabel')
|
||||||
|
|
||||||
NumericField {
|
NumericField {
|
||||||
readOnly: randomSipTcpPort.checked
|
readOnly: randomSipTcpPort.checked || !enableSipTcpPort.checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -90,8 +96,14 @@ TabContainer {
|
||||||
|
|
||||||
Switch {
|
Switch {
|
||||||
id: randomSipTcpPort
|
id: randomSipTcpPort
|
||||||
|
|
||||||
|
enabled: enableSipTcpPort.checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Switch {
|
||||||
|
id: enableSipTcpPort
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FormLine {
|
FormLine {
|
||||||
|
|
@ -99,7 +111,7 @@ TabContainer {
|
||||||
label: qsTr('audioRtpUdpPortLabel')
|
label: qsTr('audioRtpUdpPortLabel')
|
||||||
|
|
||||||
NumericField {
|
NumericField {
|
||||||
readOnly: randomAudioRtpUdpPort.checked
|
readOnly: randomAudioRtpUdpPort.checked || !enableAudioRtpUdpPort.checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -108,8 +120,14 @@ TabContainer {
|
||||||
|
|
||||||
Switch {
|
Switch {
|
||||||
id: randomAudioRtpUdpPort
|
id: randomAudioRtpUdpPort
|
||||||
|
|
||||||
|
enabled: enableAudioRtpUdpPort.checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Switch {
|
||||||
|
id: enableAudioRtpUdpPort
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FormLine {
|
FormLine {
|
||||||
|
|
@ -126,6 +144,8 @@ TabContainer {
|
||||||
|
|
||||||
Switch {
|
Switch {
|
||||||
id: randomVideoRtpUdpPort
|
id: randomVideoRtpUdpPort
|
||||||
|
|
||||||
|
enabled: enableVideoRtpUdpPort.checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue