mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-05 22:28:57 +02:00
Bug1438: Fix horizontal scrollbar, while still fixing Bug 1197
This commit is contained in:
parent
12d22cafc6
commit
4f1c8a3f2f
@ -1534,8 +1534,7 @@ void AudacityProject::FinishAutoScroll()
|
||||
|
||||
// Call our Scroll method which updates our ViewInfo variables
|
||||
// to reflect the positions of the scrollbars
|
||||
wxScrollEvent dummy;
|
||||
OnScroll(dummy);
|
||||
DoScroll();
|
||||
|
||||
mAutoScrolling = false;
|
||||
}
|
||||
@ -1600,7 +1599,7 @@ void AudacityProject::OnScrollLeftButton(wxScrollEvent & event)
|
||||
|
||||
if (pos != mHsbar->GetThumbPosition()) {
|
||||
mHsbar->SetThumbPosition((int)pos);
|
||||
OnScroll(event);
|
||||
DoScroll();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1622,7 +1621,7 @@ void AudacityProject::OnScrollRightButton(wxScrollEvent & event)
|
||||
|
||||
if (pos != mHsbar->GetThumbPosition()) {
|
||||
mHsbar->SetThumbPosition((int)pos);
|
||||
OnScroll(event);
|
||||
DoScroll();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1690,8 +1689,7 @@ void AudacityProject::TP_ScrollWindow(double scrollto)
|
||||
|
||||
// Call our Scroll method which updates our ViewInfo variables
|
||||
// to reflect the positions of the scrollbars
|
||||
wxScrollEvent dummy;
|
||||
OnScroll(dummy);
|
||||
DoScroll();
|
||||
}
|
||||
|
||||
//
|
||||
@ -1718,8 +1716,7 @@ bool AudacityProject::TP_ScrollUpDown(int delta)
|
||||
{
|
||||
mVsbar->SetThumbPosition(pos);
|
||||
|
||||
wxScrollEvent dummy;
|
||||
OnScroll(dummy);
|
||||
DoScroll();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@ -2087,6 +2084,14 @@ void AudacityProject::OnODTaskComplete(wxCommandEvent & WXUNUSED(event))
|
||||
}
|
||||
|
||||
void AudacityProject::OnScroll(wxScrollEvent & WXUNUSED(event))
|
||||
{
|
||||
const wxInt64 offset = PixelWidthBeforeTime(0.0);
|
||||
mViewInfo.sbarH =
|
||||
(wxInt64)(mHsbar->GetThumbPosition() / mViewInfo.sbarScale) - offset;
|
||||
DoScroll();
|
||||
}
|
||||
|
||||
void AudacityProject::DoScroll()
|
||||
{
|
||||
const double lowerBound = ScrollingLowerBoundTime();
|
||||
|
||||
|
@ -318,6 +318,7 @@ class AUDACITY_DLL_API AudacityProject final : public wxFrame,
|
||||
void OnSize(wxSizeEvent & event);
|
||||
void OnShow(wxShowEvent & event);
|
||||
void OnMove(wxMoveEvent & event);
|
||||
void DoScroll();
|
||||
void OnScroll(wxScrollEvent & event);
|
||||
void OnCloseWindow(wxCloseEvent & event);
|
||||
void OnTimer(wxTimerEvent & event);
|
||||
|
Loading…
x
Reference in New Issue
Block a user