use the font size for control size
This commit is contained in:
parent
94ad9f8d3f
commit
3da7704b3a
@ -25,8 +25,14 @@ DualStateButton {
|
|||||||
view: PlasmaCore.FrameSvgItem {
|
view: PlasmaCore.FrameSvgItem {
|
||||||
imagePath: "widgets/button"
|
imagePath: "widgets/button"
|
||||||
prefix: "normal"
|
prefix: "normal"
|
||||||
width: 16
|
width: fontMetricText.height + margins.left
|
||||||
height: 16
|
height: fontMetricText.height + margins.top
|
||||||
|
//FIXME: an hack to have font metrics: can we have a proper binding?
|
||||||
|
Text {
|
||||||
|
id: fontMetricText
|
||||||
|
text: "M"
|
||||||
|
visible: false
|
||||||
|
}
|
||||||
PlasmaCore.SvgItem {
|
PlasmaCore.SvgItem {
|
||||||
svg: PlasmaCore.Svg {
|
svg: PlasmaCore.Svg {
|
||||||
id: checkmarkSvg
|
id: checkmarkSvg
|
||||||
@ -34,7 +40,10 @@ DualStateButton {
|
|||||||
}
|
}
|
||||||
elementId: "checkbox"
|
elementId: "checkbox"
|
||||||
opacity: checked ? 1 : 0
|
opacity: checked ? 1 : 0
|
||||||
anchors.fill: parent
|
anchors {
|
||||||
|
fill: parent
|
||||||
|
margins: parent.margins.left/2
|
||||||
|
}
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: 250
|
duration: 250
|
||||||
|
@ -86,8 +86,8 @@ Item {
|
|||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
left: surfaceLoader.right
|
left: surfaceLoader.right
|
||||||
right: parent.right
|
right: parent.right
|
||||||
// XXX: see how this margin will be set
|
//FIXME: see how this margin will be set
|
||||||
leftMargin: hover.margins.right
|
leftMargin: height/4
|
||||||
}
|
}
|
||||||
color: theme.textColor
|
color: theme.textColor
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
@ -27,8 +27,14 @@ DualStateButton {
|
|||||||
view: PlasmaCore.FrameSvgItem {
|
view: PlasmaCore.FrameSvgItem {
|
||||||
imagePath: "widgets/button"
|
imagePath: "widgets/button"
|
||||||
prefix: "normal"
|
prefix: "normal"
|
||||||
width: 16
|
width: fontMetricText.height + margins.left
|
||||||
height: 16
|
height: fontMetricText.height + margins.top
|
||||||
|
//FIXME: an hack to have font metrics: can we have a proper binding?
|
||||||
|
Text {
|
||||||
|
id: fontMetricText
|
||||||
|
text: "M"
|
||||||
|
visible: false
|
||||||
|
}
|
||||||
PlasmaCore.SvgItem {
|
PlasmaCore.SvgItem {
|
||||||
svg: PlasmaCore.Svg {
|
svg: PlasmaCore.Svg {
|
||||||
id: checkmarkSvg
|
id: checkmarkSvg
|
||||||
@ -36,7 +42,10 @@ DualStateButton {
|
|||||||
}
|
}
|
||||||
elementId: "radiobutton"
|
elementId: "radiobutton"
|
||||||
opacity: checked ? 1 : 0
|
opacity: checked ? 1 : 0
|
||||||
anchors.fill: parent
|
anchors {
|
||||||
|
fill: parent
|
||||||
|
margins: parent.margins.left/2
|
||||||
|
}
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: 250
|
duration: 250
|
||||||
|
@ -26,10 +26,14 @@ DualStateButton {
|
|||||||
view: PlasmaCore.FrameSvgItem {
|
view: PlasmaCore.FrameSvgItem {
|
||||||
imagePath: "widgets/frame"
|
imagePath: "widgets/frame"
|
||||||
prefix: "sunken"
|
prefix: "sunken"
|
||||||
width: 32
|
width: height * 2
|
||||||
height: 16
|
height: fontMetricText.height + margins.top
|
||||||
//not used in this control
|
//FIXME: an hack to have font metrics: can we have a proper binding?
|
||||||
property bool shadowVisible
|
Text {
|
||||||
|
id: fontMetricText
|
||||||
|
text: "M"
|
||||||
|
visible: false
|
||||||
|
}
|
||||||
|
|
||||||
PlasmaCore.FrameSvgItem {
|
PlasmaCore.FrameSvgItem {
|
||||||
imagePath: "widgets/button"
|
imagePath: "widgets/button"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user