extensions/source/propctrlr/standardcontrol.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
New commits: commit 9fc99321c11202aa92fe6b932c5afd38ffe81e31 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sat Aug 16 20:54:04 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sun Aug 17 12:31:24 2025 +0200 Resolves: tdf#141033 make combobox max width the same as editboxes i.e. 30 chars wide, otherwise a long table name will stretch the page too wide to be useful Change-Id: I65151e864f178de0236cb35d133830c8bca95b9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189808 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index f5bb95f7380a..21d52e506029 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -620,11 +620,15 @@ namespace pcr notifyModifiedValue(); } + constexpr int nDefaultWidthDigits = 30; + //= OComboboxControl OComboboxControl::OComboboxControl(std::unique_ptr<weld::ComboBox> xWidget, std::unique_ptr<weld::Builder> xBuilder, bool bReadOnly) : OComboboxControl_Base(PropertyControlType::ComboBox, std::move(xBuilder), std::move(xWidget), bReadOnly) { - getTypedControlWindow()->connect_changed( LINK( this, OComboboxControl, OnEntrySelected ) ); + weld::ComboBox* pComboBox = getTypedControlWindow(); + pComboBox->connect_changed( LINK( this, OComboboxControl, OnEntrySelected ) ); + pComboBox->set_entry_width_chars(nDefaultWidthDigits); } void SAL_CALL OComboboxControl::setValue( const Any& _rValue ) @@ -777,7 +781,7 @@ namespace pcr , m_xOk(m_xBuilder->weld_button(u"ok"_ustr)) { m_xButton->set_popover(m_xPopover.get()); - m_xTextView->set_size_request(m_xTextView->get_approximate_digit_width() * 30, m_xTextView->get_height_rows(8)); + m_xTextView->set_size_request(m_xTextView->get_approximate_digit_width() * nDefaultWidthDigits, m_xTextView->get_height_rows(8)); m_xOk->connect_clicked(LINK(this, OMultilineEditControl, ButtonHandler)); }