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.mcnamara@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Caolán McNamara
2025-08-17 12:31:24 +02:00
parent b33afce35a
commit 9fc99321c1
@@ -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));
}