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 {
|
DualStateButton {
|
||||||
id: checkBox
|
id: checkBox
|
||||||
view: Rectangle {
|
view: PlasmaCore.FrameSvgItem {
|
||||||
|
imagePath: "widgets/button"
|
||||||
|
prefix: "normal"
|
||||||
width: 16
|
width: 16
|
||||||
height: 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 QtQuick 1.0
|
||||||
import org.kde.plasma.core 0.1 as PlasmaCore
|
import org.kde.plasma.core 0.1 as PlasmaCore
|
||||||
|
|
||||||
|
|
||||||
|
//FIXME: this should be round, DualStateButton shouldn't draw the shadow
|
||||||
DualStateButton {
|
DualStateButton {
|
||||||
id: radioButton
|
id: radioButton
|
||||||
view: Rectangle {
|
view: PlasmaCore.FrameSvgItem {
|
||||||
|
imagePath: "widgets/button"
|
||||||
|
prefix: "normal"
|
||||||
width: 16
|
width: 16
|
||||||
height: 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 {
|
DualStateButton {
|
||||||
id: switchItem
|
id: switchItem
|
||||||
view: Rectangle {
|
view: PlasmaCore.FrameSvgItem {
|
||||||
|
imagePath: "widgets/frame"
|
||||||
|
prefix: "sunken"
|
||||||
width: 32
|
width: 32
|
||||||
height: 16
|
height: 16
|
||||||
Rectangle {
|
PlasmaCore.FrameSvgItem {
|
||||||
|
imagePath: "widgets/button"
|
||||||
|
prefix: "normal"
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
|
@ -35,9 +39,7 @@ DualStateButton {
|
||||||
Behavior on x {
|
Behavior on x {
|
||||||
PropertyAnimation { duration: 100 }
|
PropertyAnimation { duration: 100 }
|
||||||
}
|
}
|
||||||
color: "green"
|
|
||||||
}
|
}
|
||||||
color: "grey"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user