added togglebutton styling

This commit is contained in:
Jedi18 2021-02-13 21:49:21 +05:30
parent 6540352123
commit 4996ae27a0
2 changed files with 19 additions and 8 deletions

View File

@ -105,7 +105,6 @@ ApplicationWindow {
ScrollView {
Layout.maximumHeight: 75
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
@ -168,7 +167,7 @@ ApplicationWindow {
id: encryptionToggle
checked: roomSettings.isEncryptionEnabled
onToggled: {
onClicked: {
if(roomSettings.isEncryptionEnabled) {
checked=true;
return;
@ -220,7 +219,7 @@ ApplicationWindow {
checked: roomSettings.respondsToKeyRequests
onToggled: {
onClicked: {
roomSettings.changeKeyRequestsPreference(checked)
}
}

View File

@ -1,10 +1,22 @@
import QtQuick 2.5
import QtQuick.Controls 2.3
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import im.nheko 1.0
Switch {
property color activeColor
property color disabledColor
property color inactiveColor
property color trackColor
style: SwitchStyle {
handle: Rectangle {
width: 20
height: 20
radius: 90
color: "whitesmoke"
}
groove: Rectangle {
implicitWidth: 40
implicitHeight: 20
radius: 90
color: checked ? "skyblue" : "grey"
}
}
}