Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
Fix some layout issues in with the new unit spinboxes.
Wolthera van Hövell tot Westerflier83873876d886
diff --git a/plugins/dockers/textproperties/qml/LineHeight.qml b/plugins/dockers/textproperties/qml/LineHeight.qmlindex 0c422484a6..8037a04698 100644--- a/plugins/dockers/textproperties/qml/LineHeight.qml+++ b/plugins/dockers/textproperties/qml/LineHeight.qml@@ -3,8 +3,8 @@** SPDX-License-Identifier: GPL-2.0-or-later*/-import QtQuick 2.0-import QtQuick.Controls 2.0+import QtQuick 2.15+import QtQuick.Controls 2.15import QtQuick.Layouts 1.12import org.krita.flake.text 1.0@@ -138,7 +138,12 @@ TextPropertyBase {displayText: converter.symbol;enabled: !lineHeightNormalCbx.checked;- Layout.preferredWidth: height+indicator.width;+ TextMetrics {+ id: symbolWidth;+ font: lineHeightUnitCmb.font;+ text: lineHeightUnitCmb.displayText;+ }+ Layout.preferredWidth: symbolWidth.width+leftPadding+rightPadding+spacing+indicator.width;Layout.maximumWidth: implicitWidth;PaletteControl {diff --git a/plugins/dockers/textproperties/qml/TabSize.qml b/plugins/dockers/textproperties/qml/TabSize.qmlindex 720bb0296e..e91bade640 100644--- a/plugins/dockers/textproperties/qml/TabSize.qml+++ b/plugins/dockers/textproperties/qml/TabSize.qml@@ -3,8 +3,8 @@** SPDX-License-Identifier: GPL-2.0-or-later*/-import QtQuick 2.0-import QtQuick.Controls 2.0+import QtQuick 2.15+import QtQuick.Controls 2.15import QtQuick.Layouts 1.12import org.krita.flake.text 1.0@@ -104,9 +104,16 @@ TextPropertyBase {valueRole: "value";displayText: converter.symbol;wheelEnabled: true;- Layout.preferredWidth: height+indicator.width;+ Layout.preferredWidth: symbolWidth.width+leftPadding+rightPadding+spacing+indicator.width;+ TextMetrics {+ id: symbolWidth;+ font: tabSizeUnitCmb.font;+ text: tabSizeUnitCmb.displayText;+ }Layout.maximumWidth: implicitWidth;++onCurrentValueChanged: converter.userUnit = currentValue;}diff --git a/plugins/dockers/textproperties/qml/UnitComboBox.qml b/plugins/dockers/textproperties/qml/UnitComboBox.qmlindex 626df83896..bcab2b318e 100644--- a/plugins/dockers/textproperties/qml/UnitComboBox.qml+++ b/plugins/dockers/textproperties/qml/UnitComboBox.qml@@ -22,7 +22,13 @@ SqueezedComboBox {wheelEnabled: true;- property int minimumUnitBoxWidth: height+indicator.width;+ TextMetrics {+ id: symbolWidth;+ font: root.font;+ text: displayText;+ }++ property int minimumUnitBoxWidth: symbolWidth.width+leftPadding+rightPadding+spacing+indicator.width;displayText: converter.symbol;