summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-03-07 14:05:11 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-03-07 18:06:54 +0100
commit794b93daa9bc31f4ca78d5d88a8dafb12f7ff869 (patch)
tree370e3bdcf676a89db8a7d24778a01f375801d4b5 /sd
parent6f20bcb152948a24dbe40ca2e6c4ecef2bebf853 (diff)
Resolves: tdf#146825 select under mouse on right click
if something isn't already selected Change-Id: Ifa692cd71bb71ecb5c7af732deef510f2bac5fce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131111 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/animations/CustomAnimationList.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index c5690a0c113f..9dcde6d8e9a2 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -1147,6 +1147,22 @@ IMPL_LINK(CustomAnimationList, CommandHdl, const CommandEvent&, rCEvt, bool)
if (rCEvt.GetCommand() != CommandEventId::ContextMenu)
return false;
+ if (rCEvt.IsMouseEvent())
+ {
+ ::Point aPos = rCEvt.GetMousePosPixel();
+ std::unique_ptr<weld::TreeIter> xIter(mxTreeView->make_iterator());
+ if (mxTreeView->get_dest_row_at_pos(aPos, xIter.get(), false) && !mxTreeView->is_selected(*xIter))
+ {
+ mxTreeView->unselect_all();
+ mxTreeView->set_cursor(*xIter);
+ mxTreeView->select(*xIter);
+ SelectHdl(*mxTreeView);
+ }
+ }
+
+ if (!mxTreeView->get_selected(nullptr))
+ return false;
+
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(mxTreeView.get(), "modules/simpress/ui/effectmenu.ui"));
std::unique_ptr<weld::Menu> xMenu = xBuilder->weld_menu("menu");