diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-03-10 11:13:17 +0000 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2023-03-12 18:51:28 +0000 |
commit | c5460594c21bab12db2d5a6601db84ea9726c416 (patch) | |
tree | 9c83db3889aa0c331c82968f70643b9c31e0c7eb | |
parent | 1bc139baf020ac840010d5d0dab6ce1452eb36d7 (diff) |
Resolves: tdf#154087 update scrollbar range when search criteria change
Change-Id: Iaf5f20c8952b15f3dcccb65277dadb171a705605
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148607
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r-- | cui/source/dialogs/cuicharmap.cxx | 2 | ||||
-rw-r--r-- | cui/uiconfig/ui/specialcharacters.ui | 4 | ||||
-rw-r--r-- | include/svx/searchcharmap.hxx | 1 | ||||
-rw-r--r-- | svx/source/dialog/searchcharmap.cxx | 11 |
4 files changed, 14 insertions, 4 deletions
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx index 457b5238ccdd..c6994000e36d 100644 --- a/cui/source/dialogs/cuicharmap.cxx +++ b/cui/source/dialogs/cuicharmap.cxx @@ -885,6 +885,8 @@ IMPL_LINK_NOARG(SvxCharacterMap, SearchUpdateHdl, weld::Entry&, void) if(!sName.isEmpty() && sName.toAsciiLowerCase().indexOf(aKeyword.toAsciiLowerCase()) >= 0) m_xSearchSet->AppendCharToList(sChar); } + + m_xSearchSet->UpdateScrollRange(); } else { diff --git a/cui/uiconfig/ui/specialcharacters.ui b/cui/uiconfig/ui/specialcharacters.ui index b8a7261f20af..a397c2e5762d 100644 --- a/cui/uiconfig/ui/specialcharacters.ui +++ b/cui/uiconfig/ui/specialcharacters.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.38.2 --> +<!-- Generated with glade 3.40.0 --> <interface domain="cui"> <requires lib="gtk+" version="3.20"/> <object class="GtkDialog" id="SpecialCharactersDialog"> @@ -855,6 +855,8 @@ <property name="can-focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> + <property name="hscrollbar-policy">never</property> + <property name="vscrollbar-policy">always</property> <property name="shadow-type">in</property> <child> <object class="GtkViewport"> diff --git a/include/svx/searchcharmap.hxx b/include/svx/searchcharmap.hxx index 33d7432096d8..1af4ce5fe1a6 100644 --- a/include/svx/searchcharmap.hxx +++ b/include/svx/searchcharmap.hxx @@ -50,6 +50,7 @@ public: virtual void SelectIndex( int index, bool bFocus = false ) override; void AppendCharToList(sal_UCS4 cChar); void ClearPreviousData(); + void UpdateScrollRange(); virtual sal_Int32 getMaxCharCount() const override; diff --git a/svx/source/dialog/searchcharmap.cxx b/svx/source/dialog/searchcharmap.cxx index 034ebd317a5a..2d8eeaab8967 100644 --- a/svx/source/dialog/searchcharmap.cxx +++ b/svx/source/dialog/searchcharmap.cxx @@ -307,9 +307,7 @@ void SvxSearchCharSet::RecalculateFont(vcl::RenderContext& rRenderContext) nX = aSize.Width() / COLUMN_COUNT; nY = aSize.Height() / ROW_COUNT; - //scrollbar settings -- error - int nLastRow = (nCount - 1 + COLUMN_COUNT) / COLUMN_COUNT; - mxScrollArea->vadjustment_configure(mxScrollArea->vadjustment_get_value(), 0, nLastRow, 1, ROW_COUNT - 1, ROW_COUNT); + UpdateScrollRange(); // rearrange CharSet element in sync with nX- and nY-multiples Size aDrawSize(nX * COLUMN_COUNT, nY * ROW_COUNT); @@ -319,6 +317,13 @@ void SvxSearchCharSet::RecalculateFont(vcl::RenderContext& rRenderContext) mbRecalculateFont = false; } +void SvxSearchCharSet::UpdateScrollRange() +{ + //scrollbar settings + int nLastRow = (nCount - 1 + COLUMN_COUNT) / COLUMN_COUNT; + mxScrollArea->vadjustment_configure(mxScrollArea->vadjustment_get_value(), 0, nLastRow, 1, ROW_COUNT - 1, ROW_COUNT); +} + void SvxSearchCharSet::SelectIndex(int nNewIndex, bool bFocus) { if (!mxFontCharMap.is()) |