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

View file

@ -1,10 +1,22 @@
import QtQuick 2.5 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 import im.nheko 1.0
Switch { Switch {
property color activeColor style: SwitchStyle {
property color disabledColor handle: Rectangle {
property color inactiveColor width: 20
property color trackColor height: 20
radius: 90
color: "whitesmoke"
}
groove: Rectangle {
implicitWidth: 40
implicitHeight: 20
radius: 90
color: checked ? "skyblue" : "grey"
}
}
} }