mirror of
				https://github.com/cookiengineer/audacity
				synced 2025-10-31 06:03:49 +01:00 
			
		
		
		
	Highlighting of Track Control Panel sliders
This commit is contained in:
		| @@ -2076,12 +2076,13 @@ template<typename TrackClass> | |||||||
| void TrackInfo::SliderDrawFunction | void TrackInfo::SliderDrawFunction | ||||||
| ( LWSlider *(*Selector) | ( LWSlider *(*Selector) | ||||||
|     (const wxRect &sliderRect, const TrackClass *t, bool captured, wxWindow*), |     (const wxRect &sliderRect, const TrackClass *t, bool captured, wxWindow*), | ||||||
|   wxDC *dc, const wxRect &rect, const Track *pTrack, bool captured ) |   wxDC *dc, const wxRect &rect, const Track *pTrack, | ||||||
|  |   bool captured, bool highlight ) | ||||||
| { | { | ||||||
|    wxRect sliderRect = rect; |    wxRect sliderRect = rect; | ||||||
|    TrackInfo::GetSliderHorizontalBounds( rect.GetTopLeft(), sliderRect ); |    TrackInfo::GetSliderHorizontalBounds( rect.GetTopLeft(), sliderRect ); | ||||||
|    auto wt = static_cast<const TrackClass*>( pTrack ); |    auto wt = static_cast<const TrackClass*>( pTrack ); | ||||||
|    Selector( sliderRect, wt, captured, nullptr )->OnPaint(*dc, false); |    Selector( sliderRect, wt, captured, nullptr )->OnPaint(*dc, highlight); | ||||||
| } | } | ||||||
|  |  | ||||||
| #include "tracks/playabletrack/wavetrack/ui/WaveTrackSliderHandles.h" | #include "tracks/playabletrack/wavetrack/ui/WaveTrackSliderHandles.h" | ||||||
| @@ -2094,7 +2095,7 @@ void TrackInfo::PanSliderDrawFunction | |||||||
|    bool hit = target && target->GetTrack().get() == pTrack; |    bool hit = target && target->GetTrack().get() == pTrack; | ||||||
|    bool captured = hit && target->IsClicked(); |    bool captured = hit && target->IsClicked(); | ||||||
|    SliderDrawFunction<WaveTrack> |    SliderDrawFunction<WaveTrack> | ||||||
|       ( &TrackInfo::PanSlider, dc, rect, pTrack, captured); |       ( &TrackInfo::PanSlider, dc, rect, pTrack, captured, hit); | ||||||
| } | } | ||||||
|  |  | ||||||
| void TrackInfo::GainSliderDrawFunction | void TrackInfo::GainSliderDrawFunction | ||||||
| @@ -2106,7 +2107,7 @@ void TrackInfo::GainSliderDrawFunction | |||||||
|    bool hit = target && target->GetTrack().get() == pTrack; |    bool hit = target && target->GetTrack().get() == pTrack; | ||||||
|    bool captured = hit && target->IsClicked(); |    bool captured = hit && target->IsClicked(); | ||||||
|    SliderDrawFunction<WaveTrack> |    SliderDrawFunction<WaveTrack> | ||||||
|       ( &TrackInfo::GainSlider, dc, rect, pTrack, captured); |       ( &TrackInfo::GainSlider, dc, rect, pTrack, captured, hit); | ||||||
| } | } | ||||||
|  |  | ||||||
| #ifdef EXPERIMENTAL_MIDI_OUT | #ifdef EXPERIMENTAL_MIDI_OUT | ||||||
| @@ -2120,7 +2121,7 @@ void TrackInfo::VelocitySliderDrawFunction | |||||||
|    bool hit = target && target->GetTrack().get() == pTrack; |    bool hit = target && target->GetTrack().get() == pTrack; | ||||||
|    bool captured = hit && target->IsClicked(); |    bool captured = hit && target->IsClicked(); | ||||||
|    SliderDrawFunction<NoteTrack> |    SliderDrawFunction<NoteTrack> | ||||||
|       ( &TrackInfo::VelocitySlider, dc, rect, pTrack, captured); |       ( &TrackInfo::VelocitySlider, dc, rect, pTrack, captured, hit); | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|   | |||||||
| @@ -121,7 +121,8 @@ public: | |||||||
|       ( LWSlider *(*Selector) |       ( LWSlider *(*Selector) | ||||||
|            (const wxRect &sliderRect, const TrackClass *t, bool captured, |            (const wxRect &sliderRect, const TrackClass *t, bool captured, | ||||||
|             wxWindow*), |             wxWindow*), | ||||||
|         wxDC *dc, const wxRect &rect, const Track *pTrack, bool captured ); |         wxDC *dc, const wxRect &rect, const Track *pTrack, | ||||||
|  |         bool captured, bool highlight ); | ||||||
|  |  | ||||||
|    static void PanSliderDrawFunction |    static void PanSliderDrawFunction | ||||||
|       ( TrackPanelDrawingContext &context, |       ( TrackPanelDrawingContext &context, | ||||||
|   | |||||||
| @@ -21,7 +21,9 @@ SliderHandle::SliderHandle | |||||||
|    : mSliderFn{ sliderFn } |    : mSliderFn{ sliderFn } | ||||||
|    , mRect{ rect } |    , mRect{ rect } | ||||||
|    , mpTrack{ pTrack } |    , mpTrack{ pTrack } | ||||||
| {} | { | ||||||
|  |    mChangeHighlight = RefreshCode::RefreshCell; | ||||||
|  | } | ||||||
|  |  | ||||||
| SliderHandle::~SliderHandle() | SliderHandle::~SliderHandle() | ||||||
| { | { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user