desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx | 29 +++++++--- 1 file changed, 21 insertions(+), 8 deletions(-)
New commits: commit 9d7eda0c696bdebfa186dbde242f1c2e63b48b5b Author: Michael Weghorn <[email protected]> AuthorDate: Tue Nov 11 09:35:25 2025 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Tue Nov 11 12:14:01 2025 +0100 tdf#127201 a11y extension mgr: Support triggering menu using keyboard When the list of extensions in the "Tools" -> "Extensions" dialog has focus, allow opening the context menu of the currently selected entry by pressing the context menu key. Don't require using the mouse to click on an entry. (But still support that as well, of course.) Change-Id: I8120a9b31a29598ae2d809cf021904273caa813d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193785 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx b/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx index 992f533a078f..4d37a2ef4a4d 100644 --- a/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx +++ b/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx @@ -129,22 +129,35 @@ bool ExtensionBoxWithButtons::Command(const CommandEvent& rCEvt) if (rCEvt.GetCommand() != CommandEventId::ContextMenu) return ExtensionBox::Command(rCEvt); - const Point aMousePos(rCEvt.GetMousePosPixel()); - const auto nPos = PointToPos(aMousePos); - OUString sCommand = ShowPopupMenu(aMousePos, nPos); + tools::Long nIndex = -1; + Point aPos; + if (rCEvt.IsMouseEvent()) + { + aPos = rCEvt.GetMousePosPixel(); + nIndex = PointToPos(aPos); + } + else + { + nIndex = getSelIndex(); + if (nIndex >= 0) + aPos = GetEntryRect(nIndex).Center(); + } + if (nIndex < 0) + return false; + const OUString sCommand = ShowPopupMenu(aPos, nIndex); if (sCommand == "CMD_ENABLE") - m_rParent.enablePackage(GetEntryData(nPos)->m_xPackage, true); + m_rParent.enablePackage(GetEntryData(nIndex)->m_xPackage, true); else if (sCommand == "CMD_DISABLE") - m_rParent.enablePackage(GetEntryData(nPos)->m_xPackage, false); + m_rParent.enablePackage(GetEntryData(nIndex)->m_xPackage, false); else if (sCommand == "CMD_UPDATE") - m_rParent.updatePackage(GetEntryData(nPos)->m_xPackage); + m_rParent.updatePackage(GetEntryData(nIndex)->m_xPackage); else if (sCommand == "CMD_REMOVE") - m_rParent.removePackage(GetEntryData(nPos)->m_xPackage); + m_rParent.removePackage(GetEntryData(nIndex)->m_xPackage); else if (sCommand == "CMD_SHOW_LICENSE") { m_rParent.incBusy(); - ShowLicenseDialog aLicenseDlg(m_rParent.getDialog(), GetEntryData(nPos)->m_xPackage); + ShowLicenseDialog aLicenseDlg(m_rParent.getDialog(), GetEntryData(nIndex)->m_xPackage); aLicenseDlg.run(); m_rParent.decBusy(); }
