mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-07 07:12:34 +02:00
Reduce flicker of Selection Toolbar Text
Previously there could be long delays between erasing text and painting it. Now we erase in the paint event.
This commit is contained in:
parent
5120a9dfc6
commit
c34dd3172b
@ -1299,6 +1299,7 @@ void ThemeBase::RotateImageInto( int iTo, int iFrom, bool bClockwise )
|
|||||||
|
|
||||||
BEGIN_EVENT_TABLE(auStaticText, wxWindow)
|
BEGIN_EVENT_TABLE(auStaticText, wxWindow)
|
||||||
EVT_PAINT(auStaticText::OnPaint)
|
EVT_PAINT(auStaticText::OnPaint)
|
||||||
|
EVT_ERASE_BACKGROUND(auStaticText::OnErase)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
@ -1326,6 +1327,7 @@ void auStaticText::OnPaint(wxPaintEvent & WXUNUSED(evt))
|
|||||||
{
|
{
|
||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
//dc.SetTextForeground( theTheme.Colour( clrTrackPanelText));
|
//dc.SetTextForeground( theTheme.Colour( clrTrackPanelText));
|
||||||
|
dc.Clear();
|
||||||
dc.DrawText( GetLabel(), 0,0);
|
dc.DrawText( GetLabel(), 0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,6 +180,9 @@ public:
|
|||||||
auStaticText(wxWindow* parent, wxString text);
|
auStaticText(wxWindow* parent, wxString text);
|
||||||
void OnPaint(wxPaintEvent & evt);
|
void OnPaint(wxPaintEvent & evt);
|
||||||
bool AcceptsFocus() const override { return false; }
|
bool AcceptsFocus() const override { return false; }
|
||||||
|
void OnErase(wxEraseEvent& event) {
|
||||||
|
static_cast<void>(event);
|
||||||
|
};
|
||||||
DECLARE_EVENT_TABLE();
|
DECLARE_EVENT_TABLE();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user