diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2021-01-15 11:50:12 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-01-19 12:35:29 -0800 |
commit | 3469fa70eba9a0687d9130cf79e914d4ba242fd8 (patch) | |
tree | ec4b35387652bfb4c4e9c5f12fbb981fbf967bed /mobile-widgets/qml/TemplateButton.qml | |
parent | 2c3d927a4290a88ca8287030f5d59128452c73ca (diff) | |
download | subsurface-3469fa70eba9a0687d9130cf79e914d4ba242fd8.tar.gz |
mobile/UI: offer more font sizes
As it turns out, we used to get the font scaling completely wrong. As a
result we got got ~72% and ~132% instead of the intended 85% and 115%.
So now people have both options, in each case with matching gridUnit
(and therefore visual spacing), and font size.
Also visualize the font size by rendering the button text accordingly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml/TemplateButton.qml')
-rw-r--r-- | mobile-widgets/qml/TemplateButton.qml | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mobile-widgets/qml/TemplateButton.qml b/mobile-widgets/qml/TemplateButton.qml index 49ca8c0dd..5586214a1 100644 --- a/mobile-widgets/qml/TemplateButton.qml +++ b/mobile-widgets/qml/TemplateButton.qml @@ -5,6 +5,7 @@ import org.kde.kirigami 2.4 as Kirigami Button { id: root + property double fontSize: subsurfaceTheme.regularPointSize background: Rectangle { id: buttonBackground color: root.enabled? (root.pressed ? subsurfaceTheme.darkerPrimaryColor : subsurfaceTheme.primaryColor) : "gray" @@ -15,7 +16,7 @@ Button { contentItem: Text { id: buttonText text: root.text - font.pointSize: subsurfaceTheme.regularPointSize + font.pointSize: root.fontSize anchors.centerIn: buttonBackground color: root.pressed ? subsurfaceTheme.darkerPrimaryTextColor :subsurfaceTheme.primaryTextColor } |