QmlDesigner: Fix add new state plus button centering on all sizes

Take the font size into account when centering the plus sign so it
centers well at all button heights.

Fixes: QDS-6529
Change-Id: Ie221fd2adb0fa19ad6fee1120ea33e702240960c
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Miikka Heikkinen
2022-03-24 11:15:39 +02:00
parent cd9a5b1c8d
commit 4b96545a23

View File

@@ -161,7 +161,7 @@ FocusScope {
Text { Text {
text: "+" text: "+"
anchors.centerIn: parent anchors.centerIn: parent
anchors.verticalCenterOffset: -16 anchors.verticalCenterOffset: -(5 + (font.pixelSize - 35) / 9)
font.pixelSize: parent.height * .5 font.pixelSize: parent.height * .5
color: Qt.lighter(StudioTheme.Values.themeControlBackgroundInteraction, addState.containsMouse ? 1.5 : 1) color: Qt.lighter(StudioTheme.Values.themeControlBackgroundInteraction, addState.containsMouse ? 1.5 : 1)
} }