summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-06 20:24:20 +0100
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2020-09-07 11:06:48 +0200
commit9bcb2e2f56d6a2fd9290300a0bb2d2f776780264 (patch)
treeacfb8e758634bbd3392e1be3fc3ef437164ef3d5 /sd/source
parent519d253c5525b732c624cb68495ace6eb77fa41f (diff)
tdf#136474 wait until mouse grab is dropped to trigger selection callback
Change-Id: I495b90b9661c32ad3ec71c2a2455d1576fb8f918 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102116 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.cxx15
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.hxx3
2 files changed, 18 insertions, 0 deletions
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index a55f93beecbc..37ab3c36c4f1 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;