summaryrefslogtreecommitdiff
path: root/cui/uiconfig/ui/numberdialog.ui
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2025-02-20 14:00:12 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2025-02-20 18:25:02 +0100
commit0fd4cfdc0826a4dfde62e0adf1a43dd64969af6a (patch)
tree08e8641d48f11aad21479a940b30114369cd8706 /cui/uiconfig/ui/numberdialog.ui
parentca05be9dde72a72d8b76136887381d8e25f2a215 (diff)
tdf#130857 qt weld: Avoid losing decimals in SvxDecimalNumberDialog
For QDoubleSpinBox (and thus the custom QtDoubleSpinBox subclass used in QtFormattedSpinBox), the number of decimals set via QDoubleSpinBox::setDecimals [1] does not only affect how many decimals are displayed, but also applies to the actual value used (which makes sure they are consistent). As a consequence, setting the amount of decimals to 0 results in rounding to an integer when setting the value. So far, this happened for SvxDecimalNumberDialog because the "digits" property for the "GtkSpinButton" in the .ui file uses the default value of 0. Change this to 2 instead (which matches the amount of decimals shown with both, the GTK and the VCL variants) when opening the dialog. For SvxNumberDialog that uses the same .ui file, explicitly set the number of decimals to 0, to keep the behavior unchanged for that one. This addresses those issues mentioned in previous commit Change-Id: I25707ab6c5877eea2270bc21a27d08483d0f52e6 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Thu Feb 20 11:12:51 2025 +0100 tdf#130857 qt weld: Support Svx(Decimal)NumberDialog > Handling for decimal numbers using QtInstanceFormattedSpinButton > still needs some tweaks that will be done in upcoming commits. > (For example, it currently rounds the value when double-clicking > on a proparty that has a floating point value set, and only allows > typing integer values, not actual floating point values.) [1] https://doc.qt.io/qt-6/qdoublespinbox.html#decimals-prop Change-Id: I9a242c704a1199cbbf7b16e96151d950223905b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181948 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
Diffstat (limited to 'cui/uiconfig/ui/numberdialog.ui')
-rw-r--r--cui/uiconfig/ui/numberdialog.ui1
1 files changed, 1 insertions, 0 deletions
diff --git a/cui/uiconfig/ui/numberdialog.ui b/cui/uiconfig/ui/numberdialog.ui
index a73c160efeec..86215d0795eb 100644
--- a/cui/uiconfig/ui/numberdialog.ui
+++ b/cui/uiconfig/ui/numberdialog.ui
@@ -104,6 +104,7 @@
<property name="can-focus">True</property>
<property name="truncate-multiline">True</property>
<property name="adjustment">adjustment1</property>
+ <property name="digits">2</property>
</object>
<packing>
<property name="expand">False</property>