Skip to content
Snippets Groups Projects
Commit 89f37041 authored by Sébastien Blin's avatar Sébastien Blin Committed by Kateryna Kostiuk
Browse files

pluginview: use ToggleSwitch to homogeneize style

Change-Id: I9c3a0e146173c16414e000080086c805cbbd6c95
GitLab: #601
parent d82e3820
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,7 @@ import net.jami.Adapters 1.1 ...@@ -25,6 +25,7 @@ import net.jami.Adapters 1.1
import net.jami.Constants 1.1 import net.jami.Constants 1.1
import "../commoncomponents" import "../commoncomponents"
import "../settingsview/components"
ItemDelegate { ItemDelegate {
id: root id: root
...@@ -130,7 +131,7 @@ ItemDelegate { ...@@ -130,7 +131,7 @@ ItemDelegate {
opacity: enabled ? 1.0 : 0.5 opacity: enabled ? 1.0 : 0.5
} }
Switch { ToggleSwitch {
id: btnPreferenceSwitch id: btnPreferenceSwitch
visible: preferenceType === PreferenceItemDelegate.SWITCH visible: preferenceType === PreferenceItemDelegate.SWITCH
...@@ -140,7 +141,7 @@ ItemDelegate { ...@@ -140,7 +141,7 @@ ItemDelegate {
Layout.preferredWidth: 30 Layout.preferredWidth: 30
checked: preferenceCurrentValue === "1" checked: preferenceCurrentValue === "1"
onToggled: getNewPreferenceValueSlot(checked) onSwitchToggled: getNewPreferenceValueSlot(checked)
opacity: enabled ? 1.0 : 0.5 opacity: enabled ? 1.0 : 0.5
} }
......
...@@ -94,7 +94,7 @@ ItemDelegate { ...@@ -94,7 +94,7 @@ ItemDelegate {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
Switch { ToggleSwitch {
id: loadSwitch id: loadSwitch
Layout.fillHeight: true Layout.fillHeight: true
property bool isHovering: false property bool isHovering: false
...@@ -106,29 +106,10 @@ ItemDelegate { ...@@ -106,29 +106,10 @@ ItemDelegate {
ToolTip.text: qsTr("Load/Unload") ToolTip.text: qsTr("Load/Unload")
checked: isLoaded checked: isLoaded
onClicked: { onSwitchToggled: {
btnLoadPluginToggled() btnLoadPluginToggled()
pluginListPreferencesView.isLoaded = root.isLoaded pluginListPreferencesView.isLoaded = root.isLoaded
} }
background: Rectangle {
id: switchBackground
color: "transparent"
MouseArea {
id: btnMouseArea
hoverEnabled: true
onReleased: {
loadSwitch.clicked()
}
onEntered: {
loadSwitch.isHovering = true
}
onExited: {
loadSwitch.isHovering = false
}
}
}
} }
PushButton { PushButton {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment