cui/source/dialogs/SpellDialog.cxx | 11 ++++++++++- cui/source/inc/SpellDialog.hxx | 1 + cui/uiconfig/ui/spellingdialog.ui | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-)
New commits: commit e74cfbc64e31663cb06d84d9a11b5e13c8272672 Author: Caolán McNamara <[email protected]> AuthorDate: Wed Feb 4 13:54:11 2026 +0000 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Mon Feb 9 14:10:58 2026 +0100 Resolves: tdf#170524 Lock in the start size request including scrollbar width Turn vertical scrollbar on by default, at dialog start measure width including the vertical scrollbar that might be needed later in the lifetime of the dialog even if it doesn't need it at startup time and lock that width in as the widget size request. That way it the scrollbar is needed later there is space for it without obscuring the text area. Change-Id: If4ad912d3d6eb6650ae1c891ffd7fdbbf12c0c39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198690 Reviewed-by: Miklos Vajna <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198975 Reviewed-by: Samuel Mehrbrodt <[email protected]> Tested-by: Samuel Mehrbrodt <[email protected]> diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 9dd877f80cf9..909c46e293a0 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -208,7 +208,7 @@ SpellDialog::SpellDialog(SpellDialogChildWindow* pChildWindow, Size aEdSize(m_xSuggestionLB->get_approximate_digit_width() * 60, m_xSuggestionLB->get_height_rows(6)); - m_xSuggestionLB->set_size_request(aEdSize.Width(), -1); + m_xSuggestionLB->set_size_request(aEdSize.Width(), aEdSize.Height()); m_sIgnoreOnceST = m_xIgnorePB->get_label(); m_xAddToDictMB->set_help_id(m_xAddToDictPB->get_help_id()); xSpell = LinguMgr::GetSpellChecker(); @@ -1155,6 +1155,11 @@ void SentenceEditWindow_Impl::SetDrawingArea(weld::DrawingArea* pDrawingArea) SetDocumentColor(pDrawingArea); } +void SentenceEditWindow_Impl::SetSizeRequest() +{ + m_xScrolledWindow->set_size_request(m_xScrolledWindow->get_preferred_size().Width(), -1); +} + void SentenceEditWindow_Impl::SetDocumentColor(weld::DrawingArea* pDrawingArea) { if (!pDrawingArea || !m_xEditView || !m_xEditEngine) @@ -1618,6 +1623,10 @@ void SentenceEditWindow_Impl::Init(weld::Toolbar* pToolbar) { m_pToolbar = pToolbar; m_pToolbar->connect_clicked(LINK(this,SentenceEditWindow_Impl,ToolbarHdl)); + // tdf#170524 Lock in the starting size request including space required + // for a vertical scrollbar that might be needed later in the lifetime of + // the dialog even if it doesn't need it at startup time. + SetSizeRequest(); } IMPL_LINK(SentenceEditWindow_Impl, ToolbarHdl, const OUString&, rCurItemId, void) diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx index 81d68e214314..1155ee4ab54d 100644 --- a/cui/source/inc/SpellDialog.hxx +++ b/cui/source/inc/SpellDialog.hxx @@ -68,6 +68,7 @@ private: void DoScroll(); void SetScrollBarRange(); + void SetSizeRequest(); protected: virtual bool KeyInput( const KeyEvent& rKEvt ) override; diff --git a/cui/uiconfig/ui/spellingdialog.ui b/cui/uiconfig/ui/spellingdialog.ui index f661a5a8b80e..35886d1050b0 100644 --- a/cui/uiconfig/ui/spellingdialog.ui +++ b/cui/uiconfig/ui/spellingdialog.ui @@ -157,8 +157,10 @@ <object class="GtkScrolledWindow" id="scrolledwindow"> <property name="visible">True</property> <property name="can-focus">True</property> + <property name="hexpand">True</property> <property name="border-width">0</property> <property name="hscrollbar-policy">never</property> + <property name="vscrollbar-policy">always</property> <property name="shadow-type">in</property> <child> <object class="GtkViewport"> @@ -169,6 +171,7 @@ <property name="visible">True</property> <property name="can-focus">True</property> <property name="events">GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK</property> + <property name="hexpand">True</property> <child internal-child="accessible"> <object class="AtkObject" id="sentence-atkobject"> <property name="AtkObject::accessible-description" translatable="yes" context="spellingdialog|extended_tip|sentence">Displays the sentence with the misspelled word highlighted. Edit the word or the sentence, or click one of the suggestions in the text box below.</property>
