graphics for checkboxes and radio buttons
This commit is contained in:
parent
90123fa75e
commit
e24624f80c
@ -22,9 +22,25 @@ import org.kde.plasma.core 0.1 as PlasmaCore
|
||||
|
||||
DualStateButton {
|
||||
id: checkBox
|
||||
view: Rectangle {
|
||||
view: PlasmaCore.FrameSvgItem {
|
||||
imagePath: "widgets/button"
|
||||
prefix: "normal"
|
||||
width: 16
|
||||
height: 16
|
||||
color: checked ? "green" : "blue"
|
||||
PlasmaCore.SvgItem {
|
||||
svg: PlasmaCore.Svg {
|
||||
id: checkmarkSvg
|
||||
imagePath: "widgets/checkmarks"
|
||||
}
|
||||
elementId: "checkbox"
|
||||
opacity: checked ? 1 : 0
|
||||
anchors.fill: parent
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: 250
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -20,11 +20,29 @@
|
||||
import QtQuick 1.0
|
||||
import org.kde.plasma.core 0.1 as PlasmaCore
|
||||
|
||||
|
||||
//FIXME: this should be round, DualStateButton shouldn't draw the shadow
|
||||
DualStateButton {
|
||||
id: radioButton
|
||||
view: Rectangle {
|
||||
view: PlasmaCore.FrameSvgItem {
|
||||
imagePath: "widgets/button"
|
||||
prefix: "normal"
|
||||
width: 16
|
||||
height: 16
|
||||
color: checked ? "green" : "blue"
|
||||
PlasmaCore.SvgItem {
|
||||
svg: PlasmaCore.Svg {
|
||||
id: checkmarkSvg
|
||||
imagePath: "widgets/checkmarks"
|
||||
}
|
||||
elementId: "radiobutton"
|
||||
opacity: checked ? 1 : 0
|
||||
anchors.fill: parent
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: 250
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -22,10 +22,14 @@ import org.kde.plasma.core 0.1 as PlasmaCore
|
||||
|
||||
DualStateButton {
|
||||
id: switchItem
|
||||
view: Rectangle {
|
||||
view: PlasmaCore.FrameSvgItem {
|
||||
imagePath: "widgets/frame"
|
||||
prefix: "sunken"
|
||||
width: 32
|
||||
height: 16
|
||||
Rectangle {
|
||||
PlasmaCore.FrameSvgItem {
|
||||
imagePath: "widgets/button"
|
||||
prefix: "normal"
|
||||
anchors {
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
@ -35,9 +39,7 @@ DualStateButton {
|
||||
Behavior on x {
|
||||
PropertyAnimation { duration: 100 }
|
||||
}
|
||||
color: "green"
|
||||
}
|
||||
color: "grey"
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user