switch is just a compat class for checkbox

since the guidelines forbid the switch looking switch
This commit is contained in:
Marco Martin 2014-08-19 19:14:03 +02:00
parent b3c6c294ee
commit c7ef2a34a9

View File

@ -18,8 +18,6 @@
*/
import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import "private" as Private
/**
* A check box is a component that can be switched on (checked) or off
@ -32,37 +30,9 @@ import "private" as Private
* Qt.Key_Select, Qt.Key_Return, and Qt.Key_Enter hardware keys that send the
* clicked signal.
*
* All elements of this component are defined in DualStateButton, its base component.
* @inherit QtQuick.Controls.CheckBox
*
*/
Private.DualStateButton {
id: checkBox
view: PlasmaCore.FrameSvgItem {
imagePath: "widgets/button"
prefix: "normal"
width: theme.mSize(theme.defaultFont).height + margins.left
height: theme.mSize(theme.defaultFont).height + margins.top
PlasmaCore.SvgItem {
svg: PlasmaCore.Svg {
id: checkmarkSvg
imagePath: "widgets/checkmarks"
}
elementId: "checkbox"
opacity: checked ? 1 : 0
anchors {
fill: parent
margins: parent.margins.left/2
}
Behavior on opacity {
NumberAnimation {
duration: units.longDuration
easing.type: Easing.InOutQuad
}
}
}
}
shadow: Private.ButtonShadow {}
Accessible.role: Accessible.CheckBox
CheckBox {
id: checkbox
}