mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
3469fa70eb
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>
23 lines
691 B
QML
23 lines
691 B
QML
// SPDX-License-Identifier: GPL-2.0
|
|
import QtQuick 2.6
|
|
import QtQuick.Controls 2.2
|
|
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"
|
|
antialiasing: true
|
|
radius: Kirigami.Units.smallSpacing * 2
|
|
height: buttonText.height * 2
|
|
}
|
|
contentItem: Text {
|
|
id: buttonText
|
|
text: root.text
|
|
font.pointSize: root.fontSize
|
|
anchors.centerIn: buttonBackground
|
|
color: root.pressed ? subsurfaceTheme.darkerPrimaryTextColor :subsurfaceTheme.primaryTextColor
|
|
}
|
|
}
|