diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-08-28 16:36:00 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-08-28 22:01:29 +0200 |
commit | e08b4144d9d0f0b05ef0f1c51c111d5a56e616a5 (patch) | |
tree | eb32653d2c2926a0cb2e490054a4e818e4f262c8 /vcl | |
parent | 918316ba57230b1eaaf5138507546f743687e52b (diff) |
move GetMinimumEditHeight calc to weldutils and reuse in calc
Change-Id: I3980bbaf269260243c8fcd8fe95cc03deac144ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101558
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/weldutils.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vcl/source/app/weldutils.cxx b/vcl/source/app/weldutils.cxx index 8b5532fccc8b..ee074df63d93 100644 --- a/vcl/source/app/weldutils.cxx +++ b/vcl/source/app/weldutils.cxx @@ -479,6 +479,15 @@ PatternFormatter::~PatternFormatter() m_rEntry.connect_changed(Link<weld::Entry&, void>()); m_rEntry.connect_focus_out(Link<weld::Widget&, void>()); } + +int GetMinimumEditHeight() +{ + // load this little .ui just to measure the height of an Entry + std::unique_ptr<weld::Builder> xBuilder( + Application::CreateBuilder(nullptr, "cui/ui/namedialog.ui")); + std::unique_ptr<weld::Entry> xEntry(xBuilder->weld_entry("name_entry")); + return xEntry->get_preferred_size().Height(); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |