mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
Bug2180: Type-to-create labels twice should work...
Bug began at 0750f62e88
Track::SetSelected is virtual, after all, but then LabelTrack informs
LabelTrackView of selection changes by events, so that LabelTrack remains
independent of LabelTrackView.
This might make much of the rest of the guily commit unnecessary (the resetting
of selected index to -1 only lazily), but it is harmless.
This commit is contained in:
@@ -49,6 +49,7 @@ for drawing different aspects of the label and its text box.
|
||||
wxDEFINE_EVENT(EVT_LABELTRACK_ADDITION, LabelTrackEvent);
|
||||
wxDEFINE_EVENT(EVT_LABELTRACK_DELETION, LabelTrackEvent);
|
||||
wxDEFINE_EVENT(EVT_LABELTRACK_PERMUTED, LabelTrackEvent);
|
||||
wxDEFINE_EVENT(EVT_LABELTRACK_SELECTION, LabelTrackEvent);
|
||||
|
||||
static ProjectFileIORegistry::Entry registerFactory{
|
||||
wxT( "labeltrack" ),
|
||||
@@ -249,6 +250,18 @@ LabelStruct::LabelStruct(const SelectedRegion ®ion,
|
||||
y = 0;
|
||||
}
|
||||
|
||||
void LabelTrack::SetSelected( bool s )
|
||||
{
|
||||
bool selected = GetSelected();
|
||||
Track::SetSelected( s );
|
||||
if ( selected != GetSelected() ) {
|
||||
LabelTrackEvent evt{
|
||||
EVT_LABELTRACK_SELECTION, SharedPointer<LabelTrack>(), {}, -1, -1
|
||||
};
|
||||
ProcessEvent( evt );
|
||||
}
|
||||
}
|
||||
|
||||
double LabelTrack::GetOffset() const
|
||||
{
|
||||
return mOffset;
|
||||
|
||||
Reference in New Issue
Block a user