diff --git a/src/stage/model/zoom-window.hpp b/src/stage/model/zoom-window.hpp index 2721e15ff..bed6ec1e4 100644 --- a/src/stage/model/zoom-window.hpp +++ b/src/stage/model/zoom-window.hpp @@ -276,7 +276,11 @@ namespace model { /* === Mutators === */ /** - * define the extension of the window in pixels. + * Define the extension of the window in pixels. + * The existing logical scale factor is retained, meaning that + * the logical duration of the actually visible window is adjusted + * alongside to match the new given pixel size, if necessary, also + * the canvas is expanded to fit. * @note all other manipulations will always retain this value */ void @@ -362,6 +366,13 @@ namespace model { fireChangeNotification(); } + void + setVisibleStart (TimeValue start) + { + mutateWindow (TimeSpan{start, Duration(afterWin_-startWin_)}); + fireChangeNotification(); + } + /** * explicitly set the visible window, * possibly expanding the canvas to fit. diff --git a/src/stage/timeline/body-canvas-widget.cpp b/src/stage/timeline/body-canvas-widget.cpp index df3a7c964..f067ca301 100644 --- a/src/stage/timeline/body-canvas-widget.cpp +++ b/src/stage/timeline/body-canvas-widget.cpp @@ -518,7 +518,7 @@ namespace timeline { * Find out the extension in pixels currently allocated for the content display. * @return number of pixels reasonably representing the actual visible with in the window */ - int + uint BodyCanvasWidget::getEffectiveHorizontalSize() const { int widthForDebug = contentArea_.get_allocated_width(); @@ -529,7 +529,7 @@ namespace timeline { auto hadj = contentArea_.get_hadjustment(); cout<<"|?| win::width="<get_upper()<property_value().signal_changed().connect( + sigc::bind(sigc::mem_fun(*this, &TimelineLayout::syncZoomWindow) + ,bodyCanvas_.get_focus_hadjustment())); + // make the ZoomWindow react on changes to the window geometry + bodyCanvas_.signal_size_allocate().connect( + sigc::mem_fun(*this, &TimelineLayout::sizeZoomWindow)); } @@ -143,18 +150,53 @@ namespace timeline { void TimelineLayout::establishLayout (DisplayEvaluation&) { - int contentWidthPx = bodyCanvas_.getEffectiveHorizontalSize(); - if (contentWidthPx != zoomWindow_.pxWidth()) -{////////////////////////////////////////////////////////////////TODO - cout<<"|!| zoom-calibrateExtension("<offset="<set_value(pxOffset); } void TimelineLayout::completeLayout (DisplayEvaluation&) { - /* noting to do for the collect-phase */ + /* nothing to do for the collect-phase */ + } + + /** + * Signal receiver (slot) to react on scrollbar changes. + * Changes the logical window position in the ZoomWindow to reflect + * the given #scrollPos, which is interpreted relative to the implicitly + * known size of the timeline canvas in pixels. + * @remark changes to ZoomWindow parameters cause notification of the listener, + * thereby triggering a new DisplayEvaluation; this in turn will invoke + * TimelineLayout::establishLayout() eventually, accommodating changes. + */ + void + TimelineLayout::syncZoomWindow (PAdjustment hadj) + { + double pos = hadj->get_value(); + TimeValue windowStart = applyScreenDelta(zoomWindow_.overallSpan().start(), pos); +cout<<"|!| zoom-scroll pos="< - + @@ -43389,8 +43389,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ Ja!!!
Hat lange gedauert, bis ich da drauf gekommen bin; aber das ist so eindeutig die richtige und angemessene Lösung, daß ich jetzt ausgesprochen erleichtert bin. +

+ +
+ + +
+
+ + + + + + + +

+ alle Steuersignale aus dem GUI kommen in Pixel-Einheiten, entweder absolut oder relativ; das ZoomWindow selber aber arbeitet in Zeit-Einheiten (und das ist auch seine Aufgabe). +

+ +
+
+ + + + + + + + +

+ in Grenzbereichen greift das ZoomWindow ein und begrenzt Ausschläge; selbst wenn der angeschlossene Code direkt die Pixel-Werte verwendet, muß trotzdem auf solche Eingriffe geprüft werden +

+ +
+
+
+ + + + + + + + + - + @@ -43398,6 +43502,21 @@ + + + + + + + + + + + + + + + @@ -43405,6 +43524,10 @@ + + + +