From 451673dd093dcd3fddd5ab5edd2935957b86e8c7 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 27 Mar 2021 14:42:08 +0100 Subject: [PATCH] Clip-Drag: now able to detect creation of a new clip widget ..and thus there is now one dedicated source location, where configuration of new clip widgets can be done reliably. So all prerequisites are solved and we can start building a prototypical drag-gesture implementation --- src/stage/timeline/clip-presenter.hpp | 12 +++++++++++- src/stage/timeline/clip-widget.cpp | 3 ++- wiki/thinkPad.ichthyo.mm | 25 ++++++++++++++++++++----- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/stage/timeline/clip-presenter.hpp b/src/stage/timeline/clip-presenter.hpp index bb2740d82..38fab55f8 100644 --- a/src/stage/timeline/clip-presenter.hpp +++ b/src/stage/timeline/clip-presenter.hpp @@ -215,16 +215,26 @@ namespace timeline { /** * reevaluate desired presentation mode and available data, * possibly leading to a changed appearance style of the clip. + * Whenever a new clip widget has been created, this function is also responsible + * for additional setup, and especially to enable the dragging gestures on this clip. * @remark a typical example would be, when a clip's temporal position, previously unspecified, * now becomes defined through a diff message. With this data, it becomes feasible * _actually to show the clip_ in the timeline. Thus the [Appearance style](\ref ClipDelegate::Appearance) * of the presentation widget (delegate) can be switched up from `PENDING` to `ABRIDGED`. + * @note however this function is invoked from ctor and then serves to allocate the delegate initially. */ void establishAppearance(WidgetHook* newView =nullptr, optional const& timing =nullopt) { - ClipDelegate::selectAppearance (this->widget_, defaultAppearance, newView, timing); + void* prevDelegate = widget_.get(); + auto newAppearance = ClipDelegate::selectAppearance (this->widget_, defaultAppearance, newView, timing); + + if (prevDelegate != widget_.get() + and newAppearance > ClipDelegate::DEGRADED) + {// a new dedicated clip widget has been created... + WARN (stage, "configure clip-dragging"); + } } diff --git a/src/stage/timeline/clip-widget.cpp b/src/stage/timeline/clip-widget.cpp index ebd909644..a98f594a7 100644 --- a/src/stage/timeline/clip-widget.cpp +++ b/src/stage/timeline/clip-widget.cpp @@ -347,7 +347,7 @@ namespace timeline { /** * the default implementation would ask the embedded child widgets; * however we just force the given size confinement onto them - * @todo 1/21 this kindof works, but produces lots of layout warings + * @todo 1/21 this kindof works, but produces lots of layout warnings */ void get_preferred_width_vfunc(int& minimum_width, int& natural_width) const override @@ -464,6 +464,7 @@ namespace timeline { } ENSURE (existing); return existing->changeAppearance (desired); + // fine-tune appearance style within limits of the mode established } diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 995c5882c..3d971c3bf 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -32202,7 +32202,8 @@ - + + @@ -32225,7 +32226,8 @@ - + + @@ -32240,7 +32242,8 @@ - + + @@ -32310,18 +32313,30 @@ - - + + + + + + + + + + + + + +