sd/source/ui/animations/CustomAnimationPane.cxx | 15 +++++++++++++++ sd/source/ui/animations/CustomAnimationPane.hxx | 3 +++ 2 files changed, 18 insertions(+)
New commits: commit 78389969a8f38edf4c13f0b070b4471c02f1d858 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sun Sep 6 20:24:20 2020 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Mon Sep 7 10:08:29 2020 +0200 tdf#136474 wait until mouse grab is dropped to trigger selection callback Change-Id: I495b90b9661c32ad3ec71c2a2455d1576fb8f918 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102112 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index f7bfc28fca55..1cff8f00ef1c 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -145,6 +145,7 @@ CustomAnimationPane::CustomAnimationPane( Window* pParent, ViewShellBase& rBase, , mxMFStartDelay(m_xBuilder->weld_metric_spin_button("delay_value", FieldUnit::SECOND)) , mxCBAutoPreview(m_xBuilder->weld_check_button("auto_preview")) , mxPBPlay(m_xBuilder->weld_button("play")) + , maIdle("sd idle treeview select") , mnLastSelectedAnimation(-1) , mnPropertyType(nPropertyTypeNone) , mnCurvePathPos(-1) @@ -180,6 +181,9 @@ void CustomAnimationPane::initialize() mxMFStartDelay->connect_value_changed( LINK(this, CustomAnimationPane, DelayModifiedHdl) ); mxMFStartDelay->connect_focus_out(LINK( this, CustomAnimationPane, DelayLoseFocusHdl)); + maIdle.SetPriority(TaskPriority::DEFAULT); + maIdle.SetInvokeHandler(LINK(this, CustomAnimationPane, SelectionHandler)); + maStrModify = mxFTEffect->get_label(); // get current controller and initialize listeners @@ -2073,6 +2077,17 @@ IMPL_LINK_NOARG(CustomAnimationPane, DelayLoseFocusHdl, weld::Widget&, void) IMPL_LINK_NOARG(CustomAnimationPane, AnimationSelectHdl, weld::TreeView&, void) { + maIdle.Start(); +} + +IMPL_LINK_NOARG(CustomAnimationPane, SelectionHandler, Timer*, void) +{ + if (mxLBAnimation->has_grab()) // tdf#136474 try again later + { + maIdle.Start(); + return; + } + int nSelected = mxLBAnimation->get_selected_index(); // tdf#99137, the selected entry may also be a subcategory title, so not an effect diff --git a/sd/source/ui/animations/CustomAnimationPane.hxx b/sd/source/ui/animations/CustomAnimationPane.hxx index 078bb5e69efe..94b543dcd298 100644 --- a/sd/source/ui/animations/CustomAnimationPane.hxx +++ b/sd/source/ui/animations/CustomAnimationPane.hxx @@ -113,6 +113,7 @@ private: DECL_LINK( DelayLoseFocusHdl, weld::Widget&, void ); DECL_LINK( UpdateAnimationLB, weld::ComboBox&, void ); DECL_LINK( AnimationSelectHdl, weld::TreeView&, void ); + DECL_LINK( SelectionHandler, Timer*, void ); void implControlHdl(const weld::Widget* pControl); private: @@ -142,6 +143,8 @@ private: std::unique_ptr<weld::CheckButton> mxCBAutoPreview; std::unique_ptr<weld::Button> mxPBPlay; + Idle maIdle; + OUString maStrModify; OUString maStrProperty; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits