diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-09-06 20:24:20 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-09-07 10:08:29 +0200 |
commit | 78389969a8f38edf4c13f0b070b4471c02f1d858 (patch) | |
tree | fb14bda9de3d03f368c248e5eac06e8afb38cede /sd/source | |
parent | 933dd275aafe3b3c7a76019de4878d222f0ebae6 (diff) |
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 <caolanm@redhat.com>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/animations/CustomAnimationPane.cxx | 15 | ||||
-rw-r--r-- | sd/source/ui/animations/CustomAnimationPane.hxx | 3 |
2 files changed, 18 insertions, 0 deletions
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; |