diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-03-07 14:05:11 +0000 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2022-03-08 17:04:56 +0100 |
commit | d1e28925bab3523278aa180307164ac7f8b17587 (patch) | |
tree | fe92edfa3671f1298f240704afea5f1f8a7a7c73 | |
parent | b9bdb81f3a9019a4c6c1758d980c5c26653831a3 (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/+/131130
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r-- | sd/source/ui/animations/CustomAnimationList.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index 4c18a8429c38..0fd28d6a739a 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -1148,6 +1148,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"); |