From d457e071c05c9cbe53746ec18df6d34d5d1c0f6d Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 9 Nov 2011 17:09:20 +0100 Subject: [PATCH] remove the hack of fontmetrictext --- .../plasmacomponents/qml/CheckBox.qml | 21 +++---------------- .../plasmacomponents/qml/RadioButton.qml | 19 ++--------------- .../plasmacomponents/qml/Switch.qml | 8 +------ 3 files changed, 6 insertions(+), 42 deletions(-) diff --git a/declarativeimports/plasmacomponents/qml/CheckBox.qml b/declarativeimports/plasmacomponents/qml/CheckBox.qml index 2a5b933dd..331f8891e 100644 --- a/declarativeimports/plasmacomponents/qml/CheckBox.qml +++ b/declarativeimports/plasmacomponents/qml/CheckBox.qml @@ -25,24 +25,9 @@ DualStateButton { view: PlasmaCore.FrameSvgItem { imagePath: "widgets/button" prefix: "normal" - 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 - font.capitalization: theme.defaultFont.capitalization - font.family: theme.defaultFont.family - font.italic: theme.defaultFont.italic - font.letterSpacing: theme.defaultFont.letterSpacing - font.pointSize: theme.defaultFont.pointSize - font.strikeout: theme.defaultFont.strikeout - font.underline: theme.defaultFont.underline - font.weight: theme.defaultFont.weight - font.wordSpacing: theme.defaultFont.wordSpacing - color: theme.textColor - } + width: theme.defaultFont.mSize.height + margins.left + height: theme.defaultFont.mSize.height + margins.top + PlasmaCore.SvgItem { svg: PlasmaCore.Svg { id: checkmarkSvg diff --git a/declarativeimports/plasmacomponents/qml/RadioButton.qml b/declarativeimports/plasmacomponents/qml/RadioButton.qml index cc609d7c5..2bac0e457 100644 --- a/declarativeimports/plasmacomponents/qml/RadioButton.qml +++ b/declarativeimports/plasmacomponents/qml/RadioButton.qml @@ -30,24 +30,9 @@ DualStateButton { imagePath: "widgets/actionbutton" } elementId: "normal" - width: fontMetricText.height + 6 + width: theme.defaultFont.mSize.height + 6 height: width - //FIXME: an hack to have font metrics: can we have a proper binding? - Text { - id: fontMetricText - text: "M" - visible: false - font.capitalization: theme.defaultFont.capitalization - font.family: theme.defaultFont.family - font.italic: theme.defaultFont.italic - font.letterSpacing: theme.defaultFont.letterSpacing - font.pointSize: theme.defaultFont.pointSize - font.strikeout: theme.defaultFont.strikeout - font.underline: theme.defaultFont.underline - font.weight: theme.defaultFont.weight - font.wordSpacing: theme.defaultFont.wordSpacing - color: theme.textColor - } + PlasmaCore.SvgItem { svg: PlasmaCore.Svg { id: checkmarkSvg diff --git a/declarativeimports/plasmacomponents/qml/Switch.qml b/declarativeimports/plasmacomponents/qml/Switch.qml index 6d997f538..5b1d48f07 100644 --- a/declarativeimports/plasmacomponents/qml/Switch.qml +++ b/declarativeimports/plasmacomponents/qml/Switch.qml @@ -27,13 +27,7 @@ DualStateButton { imagePath: "widgets/slider" prefix: "groove" 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 - } + height: theme.defaultFont.mSize.height + margins.top PlasmaCore.FrameSvgItem { id: highlight