use the font size for control size

This commit is contained in:
Marco Martin 2011-10-10 13:39:16 +02:00
parent 94ad9f8d3f
commit 3da7704b3a
4 changed files with 34 additions and 12 deletions

View File

@ -25,8 +25,14 @@ DualStateButton {
view: PlasmaCore.FrameSvgItem {
imagePath: "widgets/button"
prefix: "normal"
width: 16
height: 16
width: fontMetricText.height + margins.left
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 {
svg: PlasmaCore.Svg {
id: checkmarkSvg
@ -34,7 +40,10 @@ DualStateButton {
}
elementId: "checkbox"
opacity: checked ? 1 : 0
anchors.fill: parent
anchors {
fill: parent
margins: parent.margins.left/2
}
Behavior on opacity {
NumberAnimation {
duration: 250

View File

@ -86,8 +86,8 @@ Item {
bottom: parent.bottom
left: surfaceLoader.right
right: parent.right
// XXX: see how this margin will be set
leftMargin: hover.margins.right
//FIXME: see how this margin will be set
leftMargin: height/4
}
color: theme.textColor
verticalAlignment: Text.AlignVCenter

View File

@ -27,8 +27,14 @@ DualStateButton {
view: PlasmaCore.FrameSvgItem {
imagePath: "widgets/button"
prefix: "normal"
width: 16
height: 16
width: fontMetricText.height + margins.left
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 {
svg: PlasmaCore.Svg {
id: checkmarkSvg
@ -36,7 +42,10 @@ DualStateButton {
}
elementId: "radiobutton"
opacity: checked ? 1 : 0
anchors.fill: parent
anchors {
fill: parent
margins: parent.margins.left/2
}
Behavior on opacity {
NumberAnimation {
duration: 250

View File

@ -26,10 +26,14 @@ DualStateButton {
view: PlasmaCore.FrameSvgItem {
imagePath: "widgets/frame"
prefix: "sunken"
width: 32
height: 16
//not used in this control
property bool shadowVisible
width: height * 2
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.FrameSvgItem {
imagePath: "widgets/button"