Index: sources/gui/qml/pages/settings/SettingsRootSSHAccess.qml =================================================================== diff -u -r934354462a353ff5e7fc2ddfe6f3a8f0121a8f3f -r01a8c935f7d90ce3b168970765c0f20ea0c1a273 --- sources/gui/qml/pages/settings/SettingsRootSSHAccess.qml (.../SettingsRootSSHAccess.qml) (revision 934354462a353ff5e7fc2ddfe6f3a8f0121a8f3f) +++ sources/gui/qml/pages/settings/SettingsRootSSHAccess.qml (.../SettingsRootSSHAccess.qml) (revision 01a8c935f7d90ce3b168970765c0f20ea0c1a273) @@ -15,11 +15,11 @@ // Qt import QtQuick 2.12 -import QtQuick.Controls 2.12 // Switch // Qml imports import "qrc:/globals" +import "qrc:/components" /*! * \brief SettingsRootSSHAccess is the screen @@ -33,6 +33,7 @@ confirmVisible : false contentItem: Column { + spacing : 20 Row { id: _settingsRootSSHAccess_SSHDRow anchors.horizontalCenter: parent.horizontalCenter @@ -47,42 +48,10 @@ horizontalAlignment : Text.AlignLeft } - Switch { id: _settingsRootSSHAccess_SSHDSwitch - property bool active : true - - width : _root.diameter - height : _root.diameter - - indicator : Rectangle { - implicitWidth : Variables.sliderCircleDiameter * 1.7 - implicitHeight : Variables.sliderCircleDiameter - ( Variables.progressbarHandlerBorderWidth * 2 ) - radius : implicitHeight - anchors.centerIn : parent - color : _settingsRootSSHAccess_SSHDSwitch.checked ? Colors.backgroundButtonSelect : Colors.createTreatmentInactive - border.color : _settingsRootSSHAccess_SSHDSwitch.checked ? Colors.borderButton : Colors.createTreatmentInactive - Rectangle { - property real diameter : Variables.sliderCircleDiameter - x : _settingsRootSSHAccess_SSHDSwitch.checked ? parent.width - width : 0 - anchors.verticalCenter : parent.verticalCenter - width : diameter - height : diameter - radius : diameter - color : _settingsRootSSHAccess_SSHDSwitch.active ? Colors.highlightProgressBar : Colors.createTreatmentInactive - border { - width : Variables.progressbarHandlerBorderWidth - color : Colors.textMain - } - } + BaseSwitch { id: _settingsRootSSHAccess_SSHDSwitch + onClicked: { + vDevice.rootSSHAccess = toCheckState() } - - contentItem : Text { - width : parent.width - height : parent.height - font.pixelSize : Fonts.fontPixelButton - color : _settingsRootSSHAccess_SSHDSwitch.active ? Colors.textMain : Colors.textDisableButton - verticalAlignment : Text.AlignTop - horizontalAlignment : Text.AlignHCenter - } } } @@ -99,42 +68,13 @@ horizontalAlignment : Text.AlignLeft } - Switch { id: _settingsRootSSHAccess_RootSwitch - property bool active : _settingsRootSSHAccess_SSHDSwitch.checked - enabled : _settingsRootSSHAccess_RootSwitch.active - width : _root.diameter - height : _root.diameter + BaseSwitch { id: _settingsRootSSHAccess_RootSwitch + active : _settingsRootSSHAccess_SSHDSwitch.checked + enabled : _settingsRootSSHAccess_RootSwitch.active - indicator : Rectangle { - implicitWidth : Variables.sliderCircleDiameter * 1.7 - implicitHeight : Variables.sliderCircleDiameter - ( Variables.progressbarHandlerBorderWidth * 2 ) - radius : implicitHeight - anchors.centerIn : parent - color : _settingsRootSSHAccess_RootSwitch.checked ? Colors.backgroundButtonSelect : Colors.createTreatmentInactive - border.color : _settingsRootSSHAccess_RootSwitch.checked ? Colors.borderButton : Colors.createTreatmentInactive - Rectangle { - property real diameter : Variables.sliderCircleDiameter - x : _settingsRootSSHAccess_RootSwitch.checked ? parent.width - width : 0 - anchors.verticalCenter : parent.verticalCenter - width : diameter - height : diameter - radius : diameter - color : _settingsRootSSHAccess_RootSwitch.active ? Colors.highlightProgressBar : Colors.createTreatmentInactive - border { - width : Variables.progressbarHandlerBorderWidth - color : Colors.textMain - } - } + onClicked: { + vDevice.rootSSHAccess = toCheckState() } - - contentItem : Text { - width : parent.width - height : parent.height - font.pixelSize : Fonts.fontPixelButton - color : _settingsRootSSHAccess_RootSwitch.active ? Colors.textMain : Colors.textDisableButton - verticalAlignment : Text.AlignTop - horizontalAlignment : Text.AlignHCenter - } } } } @@ -166,16 +106,6 @@ _settingsRootSSHAccess_RootSwitch.checked = root } - Connections { target: _settingsRootSSHAccess_SSHDSwitch - function onClicked() { - vDevice.rootSSHAccess = toCheckState() - } - } - Connections { target: _settingsRootSSHAccess_RootSwitch - function onClicked() { - vDevice.rootSSHAccess = toCheckState() - } - } Connections { target: vDevice // in case the value is rejecte it will be set to the previous value // also the init value shall be set when navigate to the screen