switch is just a compat class for checkbox
since the guidelines forbid the switch looking switch
This commit is contained in:
parent
b3c6c294ee
commit
c7ef2a34a9
|
@ -18,8 +18,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import QtQuick 2.1
|
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
|
* 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
|
* Qt.Key_Select, Qt.Key_Return, and Qt.Key_Enter hardware keys that send the
|
||||||
* clicked signal.
|
* clicked signal.
|
||||||
*
|
*
|
||||||
* All elements of this component are defined in DualStateButton, its base component.
|
* @inherit QtQuick.Controls.CheckBox
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Private.DualStateButton {
|
CheckBox {
|
||||||
id: checkBox
|
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
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user