sw/source/uibase/sidebar/QuickFindPanel.cxx |    7 +++++++
 sw/source/uibase/sidebar/QuickFindPanel.hxx |    1 +
 2 files changed, 8 insertions(+)

New commits:
commit 63765c15a10cf41123c31b917d7aa9358405456b
Author:     Jim Raykowski <[email protected]>
AuthorDate: Mon Sep 29 00:53:58 2025 -0800
Commit:     Xisco Fauli <[email protected]>
CommitDate: Tue Sep 30 13:12:23 2025 +0200

    tdf#168560 Sidebar Find: Select text on keyboard focus in find entry box
    
    Like with the find entry box in the F&R dialog there is a bit of glitch
    when using gtk VCL when the find text is not selected and is click on it
    becomes selected and then not selected.
    
    Change-Id: I879f85b676d737d03c4bb02069f5d80f385d343d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191600
    Tested-by: Heiko Tietze <[email protected]>
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <[email protected]>
    Reviewed-by: Jim Raykowski <[email protected]>
    (cherry picked from commit 4f33bb0f672a450ee5f2a4fd502398f2008fd7a8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191650
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sw/source/uibase/sidebar/QuickFindPanel.cxx 
b/sw/source/uibase/sidebar/QuickFindPanel.cxx
index a5e633254ab0..9087c445c551 100644
--- a/sw/source/uibase/sidebar/QuickFindPanel.cxx
+++ b/sw/source/uibase/sidebar/QuickFindPanel.cxx
@@ -123,6 +123,7 @@ QuickFindPanel::QuickFindPanel(weld::Widget* pParent, const 
uno::Reference<frame
         = 
m_xBuilder->weld_widget(u"box"_ustr)->get_preferred_size().getWidth() + (6 * 2) 
+ 6;
     m_xContainer->set_size_request(m_nMinimumPanelWidth, 1);
 
+    m_xSearchFindEntry->connect_focus_in(LINK(this, QuickFindPanel, 
SearchFindEntryFocusInHandler));
     m_xSearchFindEntry->connect_activate(
         LINK(this, QuickFindPanel, SearchFindEntryActivateHandler));
     m_xSearchFindEntry->connect_changed(LINK(this, QuickFindPanel, 
SearchFindEntryChangedHandler));
@@ -201,6 +202,12 @@ QuickFindPanel::~QuickFindPanel()
     m_xSearchFindsList.reset();
 }
 
+IMPL_LINK_NOARG(QuickFindPanel, SearchFindEntryFocusInHandler, weld::Widget&, 
void)
+{
+    if (m_xSearchFindEntry->get_text().getLength())
+        m_xSearchFindEntry->select_region(0, 
m_xSearchFindEntry->get_text().getLength());
+}
+
 IMPL_LINK_NOARG(QuickFindPanel, SearchFindEntryChangedHandler, weld::Entry&, 
void)
 {
     m_xSearchFindEntry->set_message_type(weld::EntryMessageType::Normal);
diff --git a/sw/source/uibase/sidebar/QuickFindPanel.hxx 
b/sw/source/uibase/sidebar/QuickFindPanel.hxx
index 2875229bb9c2..ac17e8567ef6 100644
--- a/sw/source/uibase/sidebar/QuickFindPanel.hxx
+++ b/sw/source/uibase/sidebar/QuickFindPanel.hxx
@@ -72,6 +72,7 @@ private:
     sal_uInt16 m_nLEVShorter = 2;
     sal_uInt16 m_nLEVLonger = 2;
 
+    DECL_LINK(SearchFindEntryFocusInHandler, weld::Widget&, void);
     DECL_LINK(SearchFindEntryActivateHandler, weld::Entry&, bool);
     DECL_LINK(SearchFindEntryChangedHandler, weld::Entry&, void);
     DECL_LINK(SearchFindsListCustomGetSizeHandler, 
weld::TreeView::get_size_args, Size);

Reply via email to