From 811065cff4c741245c9a7e6d03b1c67c69b2c218 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Fri, 2 Apr 2021 01:11:44 -0500 Subject: [PATCH] Bug 2694 - Coloring of tracks in Mixer Board are awry --- src/widgets/ASlider.cpp | 21 +++++++++++++++++++++ src/widgets/ASlider.h | 5 +++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/widgets/ASlider.cpp b/src/widgets/ASlider.cpp index 00e0b2506..03b6291c4 100644 --- a/src/widgets/ASlider.cpp +++ b/src/widgets/ASlider.cpp @@ -1532,6 +1532,15 @@ void LWSlider::Refresh() mParent->Refresh(false); } +void LWSlider::Redraw() +{ + mBitmap.reset(); + mThumbBitmap.reset(); + mThumbBitmapHilited.reset(); + + Refresh(); +} + bool LWSlider::GetEnabled() const { return mEnabled; @@ -1616,6 +1625,18 @@ ASlider::~ASlider() ReleaseMouse(); } +bool ASlider::SetBackgroundColour(const wxColour& colour) +{ + auto res = wxPanel::SetBackgroundColour(colour); + + if (res && mLWSlider) + { + mLWSlider->Redraw(); + } + + return res; +} + void ASlider::OnSlider(wxCommandEvent &event) { diff --git a/src/widgets/ASlider.h b/src/widgets/ASlider.h index f50b2bddb..8b8d3b116 100644 --- a/src/widgets/ASlider.h +++ b/src/widgets/ASlider.h @@ -136,6 +136,7 @@ class LWSlider void OnMouseEvent(wxMouseEvent & event); void OnKeyDown(wxKeyEvent & event); void Refresh(); + void Redraw(); bool ShowDialog(); bool ShowDialog(wxPoint pos); @@ -146,8 +147,6 @@ class LWSlider float GetMinValue() const; float GetMaxValue() const; - static void DeleteSharedTipPanel(); - void SetParent(wxWindow *parent) { mParent = parent; } void SendUpdate(float newValue); @@ -272,6 +271,8 @@ class ASlider /* not final */ : public wxPanel void SetFocusFromKbd() override; + bool SetBackgroundColour(const wxColour& colour) override; + void GetScroll(float & line, float & page); void SetScroll(float line, float page);