diff options
| author | xiphon <xiphon@protonmail.com> | 2020-05-02 00:14:29 +0000 |
|---|---|---|
| committer | xiphon <xiphon@protonmail.com> | 2020-05-02 01:54:05 +0000 |
| commit | ca79525fdb4e462a435d9914a46fcef449577f9d (patch) | |
| tree | 521060c62bafb31d633a793a484a0fa06dc2e6db /pages/settings | |
| parent | ce6cc47afedb05b7b47b1f713429e85474239f90 (diff) | |
| download | monzero-gui-ca79525fdb4e462a435d9914a46fcef449577f9d.tar.gz monzero-gui-ca79525fdb4e462a435d9914a46fcef449577f9d.tar.xz monzero-gui-ca79525fdb4e462a435d9914a46fcef449577f9d.zip | |
Slider component
Diffstat (limited to 'pages/settings')
| -rw-r--r-- | pages/settings/SettingsLayout.qml | 70 |
1 files changed, 10 insertions, 60 deletions
diff --git a/pages/settings/SettingsLayout.qml b/pages/settings/SettingsLayout.qml index 4d338045..0d32b88e 100644 --- a/pages/settings/SettingsLayout.qml +++ b/pages/settings/SettingsLayout.qml @@ -101,70 +101,20 @@ Rectangle { text: qsTr("Lock wallet on inactivity") + translationManager.emptyString } - ColumnLayout { + MoneroComponents.Slider { visible: userInActivityCheckbox.checked Layout.fillWidth: true Layout.topMargin: 6 - Layout.leftMargin: 42 - spacing: 0 - - Text { - color: MoneroComponents.Style.defaultFontColor - font.pixelSize: 14 - Layout.fillWidth: true - text: { - var val = userInactivitySlider.value; - var minutes = val > 1 ? qsTr("minutes") : qsTr("minute"); - - qsTr("After ") + val + " " + minutes + translationManager.emptyString; - } - } - - Slider { - id: userInactivitySlider - from: 1 - value: persistentSettings.lockOnUserInActivityInterval - to: 60 - leftPadding: 0 - stepSize: 1 - snapMode: Slider.SnapAlways - - background: Rectangle { - x: parent.leftPadding - y: parent.topPadding + parent.availableHeight / 2 - height / 2 - implicitWidth: 200 - implicitHeight: 4 - width: parent.availableWidth - height: implicitHeight - radius: 2 - color: MoneroComponents.Style.progressBarBackgroundColor - - Rectangle { - width: parent.visualPosition * parent.width - height: parent.height - color: MoneroComponents.Style.green - radius: 2 - } - } - - handle: Rectangle { - x: parent.leftPadding + parent.visualPosition * (parent.availableWidth - width) - y: parent.topPadding + parent.availableHeight / 2 - height / 2 - implicitWidth: 18 - implicitHeight: 18 - radius: 8 - color: parent.pressed ? "#f0f0f0" : "#f6f6f6" - border.color: MoneroComponents.Style.grey - } - - onMoved: persistentSettings.lockOnUserInActivityInterval = userInactivitySlider.value; - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.NoButton - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - } + Layout.leftMargin: 35 + from: 1 + stepSize: 1 + to: 60 + value: persistentSettings.lockOnUserInActivityInterval + text: { + var minutes = value > 1 ? qsTr("minutes") : qsTr("minute"); + return qsTr("After ") + value + " " + minutes + translationManager.emptyString; } + onMoved: persistentSettings.lockOnUserInActivityInterval = value } //! Manage pricing |
