diff options
-rw-r--r-- | include/svtools/scrolladaptor.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/inc/tabview.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 11 | ||||
-rw-r--r-- | svtools/source/control/scrolladaptor.cxx | 5 |
4 files changed, 18 insertions, 0 deletions
diff --git a/include/svtools/scrolladaptor.hxx b/include/svtools/scrolladaptor.hxx index d321091ac4de..cdc507078cf8 100644 --- a/include/svtools/scrolladaptor.hxx +++ b/include/svtools/scrolladaptor.hxx @@ -54,6 +54,7 @@ public: virtual tools::Long GetThumbPos() const override; void SetScrollHdl(const Link<weld::Scrollbar&, void>& rLink); + void SetMouseReleaseHdl(const Link<const MouseEvent&, bool>& rLink); // what is it bool IsHoriScroll() const { return m_bHori; } diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index 7fdb0cc3c2c2..ca3918aae325 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -226,6 +226,7 @@ private: DECL_LINK(HScrollRightHdl, weld::Scrollbar&, void ); DECL_LINK(VScrollTopHdl, weld::Scrollbar&, void ); DECL_LINK(VScrollBottomHdl, weld::Scrollbar&, void ); + DECL_LINK(EndScrollHdl, const MouseEvent&, bool); void ScrollHdl(ScrollAdaptor* rScrollBar); DECL_LINK(SplitHdl, Splitter*, void); diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 4248fdd08526..607e5ddc60d2 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -228,6 +228,7 @@ void ScTabView::InitScrollBar(ScrollAdaptor& rScrollBar, tools::Long nMaxVal, co rScrollBar.SetVisibleSize( 10 ); // is reset by Resize rScrollBar.SetScrollHdl(rLink); + rScrollBar.SetMouseReleaseHdl(LINK(this, ScTabView, EndScrollHdl)); rScrollBar.EnableRTL( aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() ) ); } @@ -1054,6 +1055,16 @@ IMPL_LINK_NOARG(ScTabView, VScrollBottomHdl, weld::Scrollbar&, void) ScrollHdl(aVScrollBottom.get()); } +IMPL_LINK_NOARG(ScTabView, EndScrollHdl, const MouseEvent&, bool) +{ + if (bDragging) + { + UpdateScrollBars(); + bDragging = false; + } + return false; +} + void ScTabView::ScrollHdl(ScrollAdaptor* pScroll) { bool bHoriz = ( pScroll == aHScrollLeft.get() || pScroll == aHScrollRight.get() ); diff --git a/svtools/source/control/scrolladaptor.cxx b/svtools/source/control/scrolladaptor.cxx index 14480f0c7d2d..64799a15e96d 100644 --- a/svtools/source/control/scrolladaptor.cxx +++ b/svtools/source/control/scrolladaptor.cxx @@ -106,6 +106,11 @@ void ScrollAdaptor::SetScrollHdl(const Link<weld::Scrollbar&, void>& rLink) m_xScrollBar->connect_adjustment_changed(rLink); } +void ScrollAdaptor::SetMouseReleaseHdl(const Link<const MouseEvent&, bool>& rLink) +{ + m_xScrollBar->connect_mouse_release(rLink); +} + tools::Long ScrollAdaptor::DoScroll(tools::Long nNewPos) { const auto nOrig = m_xScrollBar->adjustment_get_value(); |