Commit 8a5bb3a5 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Settings/SettingsNetwork): view in progress

parent 95fb6b96
...@@ -3,9 +3,9 @@ import QtQuick 2.7 ...@@ -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 ...@@ -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
? (
control.checked
? SwitchStyle.indicator.border.color.checked ? SwitchStyle.indicator.border.color.checked
: SwitchStyle.indicator.border.color.normal : SwitchStyle.indicator.border.color.normal
) : SwitchStyle.indicator.border.color.disabled
color: control.checked color: control.enabled
? (
control.checked
? SwitchStyle.indicator.color.checked ? SwitchStyle.indicator.color.checked
: SwitchStyle.indicator.color.normal : 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 { ...@@ -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 border.color: control.enabled
?
(
control.checked
? (
control.down
? SwitchStyle.sphere.border.color.pressed ? SwitchStyle.sphere.border.color.pressed
: SwitchStyle.sphere.border.color.checked : SwitchStyle.sphere.border.color.checked
) : SwitchStyle.sphere.border.color.normal ) : SwitchStyle.sphere.border.color.normal
) : SwitchStyle.sphere.border.color.disabled
color: control.down color: control.enabled
?
(
control.down
? SwitchStyle.sphere.color.pressed ? SwitchStyle.sphere.color.pressed
: SwitchStyle.sphere.color.normal : 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 { ...@@ -65,4 +88,12 @@ Switch {
} }
} }
} }
// ---------------------------------------------------------------------------
MouseArea {
anchors.fill: parent
onClicked: control.enabled && control.toggle()
}
} }
...@@ -17,12 +17,14 @@ QtObject { ...@@ -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 { ...@@ -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 { ...@@ -63,7 +63,7 @@ TabContainer {
label: qsTr('sipUdpPortLabel') label: qsTr('sipUdpPortLabel')
NumericField { NumericField {
readOnly: randomSipUdpPort.checked readOnly: randomSipUdpPort.checked || !enableSipUdpPort.checked
} }
} }
...@@ -72,7 +72,13 @@ TabContainer { ...@@ -72,7 +72,13 @@ TabContainer {
Switch { Switch {
id: randomSipUdpPort id: randomSipUdpPort
enabled: enableSipUdpPort.checked
}
} }
Switch {
id: enableSipUdpPort
} }
} }
...@@ -81,7 +87,7 @@ TabContainer { ...@@ -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 { ...@@ -90,8 +96,14 @@ TabContainer {
Switch { Switch {
id: randomSipTcpPort id: randomSipTcpPort
enabled: enableSipTcpPort.checked
} }
} }
Switch {
id: enableSipTcpPort
}
} }
FormLine { FormLine {
...@@ -99,7 +111,7 @@ TabContainer { ...@@ -99,7 +111,7 @@ TabContainer {
label: qsTr('audioRtpUdpPortLabel') label: qsTr('audioRtpUdpPortLabel')
NumericField { NumericField {
readOnly: randomAudioRtpUdpPort.checked readOnly: randomAudioRtpUdpPort.checked || !enableAudioRtpUdpPort.checked
} }
} }
...@@ -108,7 +120,13 @@ TabContainer { ...@@ -108,7 +120,13 @@ TabContainer {
Switch { Switch {
id: randomAudioRtpUdpPort id: randomAudioRtpUdpPort
enabled: enableAudioRtpUdpPort.checked
}
} }
Switch {
id: enableAudioRtpUdpPort
} }
} }
...@@ -126,6 +144,8 @@ TabContainer { ...@@ -126,6 +144,8 @@ TabContainer {
Switch { Switch {
id: randomVideoRtpUdpPort id: randomVideoRtpUdpPort
enabled: enableVideoRtpUdpPort.checked
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment