diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-04-14 20:13:17 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-04-15 20:44:49 +0200 |
commit | d1da1c59d196b7f6037b7e0820b81fc527d56a4c (patch) | |
tree | e5ee0df76dceb2f43a7d0a83db525978d5f95c7d /svx | |
parent | fbfda267e8f4b55dff30a3827bff760565f36fdb (diff) |
tdf#148349 add a way to call the user's attention to a widget
Change-Id: I2846155a44f3e51ddd8cc1acd81e84a38b4d3934
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133030
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/tbxctrls/tbunosearchcontrollers.cxx | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index 6deb930c18f2..b168462baf2d 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -295,22 +295,29 @@ IMPL_LINK(FindTextFieldControl, KeyInputHdl, const KeyEvent&, rKeyEvent, bool) } } } - // Select text in the search box when Ctrl-F pressed - else if ( bMod1 && nCode == KEY_F ) - m_xWidget->select_entry_region(0, -1); - - // Execute the search when Ctrl-G, F3 and Shift-RETURN pressed (in addition to ActivateHdl condition which handles bare RETURN) - else if ( (bMod1 && KEY_G == nCode) || (bShift && KEY_RETURN == nCode) || (KEY_F3 == nCode) ) - { - ActivateFind(bShift); - bRet = true; - } else { auto awtKey = svt::AcceleratorExecute::st_VCLKey2AWTKey(rKeyEvent.GetKeyCode()); const OUString aCommand(m_pAcc->findCommand(awtKey)); - if (aCommand == ".uno:SearchDialog") + + // Select text in the search box when Ctrl-F pressed + if ( bMod1 && nCode == KEY_F ) + m_xWidget->select_entry_region(0, -1); + // Execute the search when Ctrl-G, F3 and Shift-RETURN pressed (in addition to ActivateHdl condition which handles bare RETURN) + else if ( (bMod1 && KEY_G == nCode) || (bShift && KEY_RETURN == nCode) || (KEY_F3 == nCode) ) + { + ActivateFind(bShift); + bRet = true; + } + else if (aCommand == ".uno:SearchDialog") bRet = m_pAcc->execute(awtKey); + + // find-shortcut called with focus already in find + if (aCommand == "vnd.sun.star.findbar:FocusToFindbar") + { + m_xWidget->call_attention_to(); + bRet = true; + } } return bRet || ChildKeyInput(rKeyEvent); |