mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-07-25 18:05:34 +02:00
pluginview: use ToggleSwitch to homogeneize style
Change-Id: I9c3a0e146173c16414e000080086c805cbbd6c95 GitLab: #601
This commit is contained in:
parent
d82e382070
commit
89f3704109
2 changed files with 5 additions and 23 deletions
|
@ -25,6 +25,7 @@ import net.jami.Adapters 1.1
|
|||
import net.jami.Constants 1.1
|
||||
|
||||
import "../commoncomponents"
|
||||
import "../settingsview/components"
|
||||
|
||||
ItemDelegate {
|
||||
id: root
|
||||
|
@ -130,7 +131,7 @@ ItemDelegate {
|
|||
opacity: enabled ? 1.0 : 0.5
|
||||
}
|
||||
|
||||
Switch {
|
||||
ToggleSwitch {
|
||||
id: btnPreferenceSwitch
|
||||
|
||||
visible: preferenceType === PreferenceItemDelegate.SWITCH
|
||||
|
@ -140,7 +141,7 @@ ItemDelegate {
|
|||
Layout.preferredWidth: 30
|
||||
checked: preferenceCurrentValue === "1"
|
||||
|
||||
onToggled: getNewPreferenceValueSlot(checked)
|
||||
onSwitchToggled: getNewPreferenceValueSlot(checked)
|
||||
opacity: enabled ? 1.0 : 0.5
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ ItemDelegate {
|
|||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
Switch {
|
||||
ToggleSwitch {
|
||||
id: loadSwitch
|
||||
Layout.fillHeight: true
|
||||
property bool isHovering: false
|
||||
|
@ -106,29 +106,10 @@ ItemDelegate {
|
|||
ToolTip.text: qsTr("Load/Unload")
|
||||
|
||||
checked: isLoaded
|
||||
onClicked: {
|
||||
onSwitchToggled: {
|
||||
btnLoadPluginToggled()
|
||||
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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue