mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-23 15:50:05 +02:00
Fix some display problems in scrolling play: mitigate scrollbar flashing, and...
This commit is contained in:
commit
ac5e6a021d
@ -243,10 +243,31 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetScrollbar(int position, int thumbSize,
|
||||||
|
int range, int pageSize,
|
||||||
|
bool refresh = true) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void ScrollBar::SetScrollbar(int position, int thumbSize,
|
||||||
|
int range, int pageSize,
|
||||||
|
bool refresh)
|
||||||
|
{
|
||||||
|
// Mitigate flashing of scrollbars by refreshing only when something really changes.
|
||||||
|
|
||||||
|
auto changed =
|
||||||
|
position != GetThumbPosition() ||
|
||||||
|
thumbSize != GetThumbSize() ||
|
||||||
|
range != GetRange() ||
|
||||||
|
pageSize != GetPageSize();
|
||||||
|
if (!changed)
|
||||||
|
return;
|
||||||
|
|
||||||
|
wxScrollBar::SetScrollbar(position, thumbSize, range, pageSize, refresh);
|
||||||
|
}
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(ScrollBar, wxScrollBar)
|
BEGIN_EVENT_TABLE(ScrollBar, wxScrollBar)
|
||||||
EVT_SET_FOCUS(ScrollBar::OnSetFocus)
|
EVT_SET_FOCUS(ScrollBar::OnSetFocus)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
@ -1775,7 +1796,6 @@ void AudacityProject::FixScrollbars()
|
|||||||
|
|
||||||
mHsbar->SetScrollbar(scaledSbarH + offset, scaledSbarScreen, scaledSbarTotal,
|
mHsbar->SetScrollbar(scaledSbarH + offset, scaledSbarScreen, scaledSbarTotal,
|
||||||
scaledSbarScreen, TRUE);
|
scaledSbarScreen, TRUE);
|
||||||
mHsbar->Refresh();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vertical scrollbar
|
// Vertical scrollbar
|
||||||
@ -1783,7 +1803,6 @@ void AudacityProject::FixScrollbars()
|
|||||||
panelHeight / mViewInfo.scrollStep,
|
panelHeight / mViewInfo.scrollStep,
|
||||||
totalHeight / mViewInfo.scrollStep,
|
totalHeight / mViewInfo.scrollStep,
|
||||||
panelHeight / mViewInfo.scrollStep, TRUE);
|
panelHeight / mViewInfo.scrollStep, TRUE);
|
||||||
mVsbar->Refresh();
|
|
||||||
|
|
||||||
if (refresh || (rescroll &&
|
if (refresh || (rescroll &&
|
||||||
(GetScreenEndTime() - mViewInfo.h) < mViewInfo.total)) {
|
(GetScreenEndTime() - mViewInfo.h) < mViewInfo.total)) {
|
||||||
|
@ -479,8 +479,12 @@ void TranscriptionToolBar::OnPlaySpeed(wxCommandEvent & WXUNUSED(event))
|
|||||||
auto doubleClicked = button->IsDoubleClicked();
|
auto doubleClicked = button->IsDoubleClicked();
|
||||||
button->ClearDoubleClicked();
|
button->ClearDoubleClicked();
|
||||||
|
|
||||||
if (doubleClicked)
|
if (doubleClicked) {
|
||||||
GetActiveProject()->GetPlaybackScroller().Activate(true);
|
GetActiveProject()->GetPlaybackScroller().Activate(true);
|
||||||
|
|
||||||
|
// Pop up the button
|
||||||
|
SetButton(false, button);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
// Let control have precedence over shift
|
// Let control have precedence over shift
|
||||||
const bool cutPreview = mButtons[TTB_PlaySpeed]->WasControlDown();
|
const bool cutPreview = mButtons[TTB_PlaySpeed]->WasControlDown();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user