Index: sources/gui/qml/pages/settings/SettingsRootSSHAccess.qml =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r94c7a571dc12f24aa072ac2b14199432ce9f3821 --- sources/gui/qml/pages/settings/SettingsRootSSHAccess.qml (.../SettingsRootSSHAccess.qml) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/gui/qml/pages/settings/SettingsRootSSHAccess.qml (.../SettingsRootSSHAccess.qml) (revision 94c7a571dc12f24aa072ac2b14199432ce9f3821) @@ -15,11 +15,12 @@ // Qt import QtQuick 2.12 -import QtQuick.Controls 2.12 // Switch // Qml imports import "qrc:/globals" +import "qrc:/components" +import "qrc:/compounds" /*! * \brief SettingsRootSSHAccess is the screen @@ -32,105 +33,38 @@ confirmVisible : false - Column { - anchors.centerIn: parent - Row { id: _settingsRootSSHAccess_SSHDRow - Text { id: _settingsRootSSHAccess_SSHDLabel - text : qsTr("Enable SSH Login") - width : 300 - height : _settingsRootSSHAccess_SSHDSwitch.height - color : Colors.white - font.pixelSize : Fonts.fontPixelButton - verticalAlignment : Text.AlignVCenter - horizontalAlignment : Text.AlignLeft - } + contentItem: Column { + spacing : 25 - Switch { id: _settingsRootSSHAccess_SSHDSwitch - property bool active : true + LabelUnitContainer { id: _settingsRootSSHAccess_SSHDRow + anchors.horizontalCenter : parent.horizontalCenter + width : Variables.adjustmentLabelUnitContainerWidth + height : Variables.adjustmentLabelUnitContainerHeight + showUnit : false + text : qsTr("Enable SSH Login") + contentArea.anchors.leftMargin : width * 0.75 - 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 - } - } + contentItem: 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 - } } } - Row { id: _settingsRootSSHAccess_RootRow - Text { id: _settingsRootSSHAccess_RootLabel - text : qsTr("Enable Root Login") - width : 300 - height : _settingsRootSSHAccess_RootSwitch.height - color : Colors.white - font.pixelSize : Fonts.fontPixelButton - verticalAlignment : Text.AlignVCenter - horizontalAlignment : Text.AlignLeft - } + LabelUnitContainer { id: _settingsRootSSHAccess_RootRow + anchors.horizontalCenter : parent.horizontalCenter + width : Variables.adjustmentLabelUnitContainerWidth + height : Variables.adjustmentLabelUnitContainerHeight + showUnit : false + text : qsTr("Enable Root Login") + contentArea.anchors.leftMargin : width * 0.75 - Switch { id: _settingsRootSSHAccess_RootSwitch - property bool active : _settingsRootSSHAccess_SSHDSwitch.checked - enabled : _settingsRootSSHAccess_RootSwitch.active - 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_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 - } - } + contentItem: BaseSwitch { id: _settingsRootSSHAccess_RootSwitch + active : _settingsRootSSHAccess_SSHDSwitch.checked + enabled : _settingsRootSSHAccess_RootSwitch.active + 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 - } } } } @@ -162,16 +96,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