From b06d2c86a864fcf25fdf8963b59134a9827d2df6 Mon Sep 17 00:00:00 2001 From: Geoff Lankow Date: Fri, 9 Feb 2018 21:06:51 +1300 Subject: Reduce width of Transform dialog by making spinbuttons narrower --- src/ui/widget/scalar.cpp | 6 ++++++ src/ui/widget/scalar.h | 5 +++++ 2 files changed, 11 insertions(+) (limited to 'src/ui/widget') diff --git a/src/ui/widget/scalar.cpp b/src/ui/widget/scalar.cpp index a3fff0c8c..58afa9726 100644 --- a/src/ui/widget/scalar.cpp +++ b/src/ui/widget/scalar.cpp @@ -130,6 +130,12 @@ void Scalar::setValue(double value, bool setProg) static_cast(_widget)->set_value(value); } +void Scalar::setWidthChars(uint chars) +{ + g_assert(_widget != NULL); + static_cast(_widget)->set_width_chars(chars); +} + void Scalar::update() { g_assert(_widget != nullptr); diff --git a/src/ui/widget/scalar.h b/src/ui/widget/scalar.h index 2632dd5a7..0d9ed9c4b 100644 --- a/src/ui/widget/scalar.h +++ b/src/ui/widget/scalar.h @@ -137,6 +137,11 @@ public: */ void setValue(double value, bool setProg = true); + /** + * Sets the width of the spin button by number of characters. + */ + void setWidthChars(unsigned chars); + /** * Manually forces an update of the spin button. */ -- cgit v1.2.3