mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-26 15:23:48 +01:00
Remove GetActiveProject where finding track panel button tooltips
This commit is contained in:
@@ -42,16 +42,15 @@ UIHandle::Result MuteButtonHandle::CommitChanges
|
||||
}
|
||||
|
||||
TranslatableString MuteButtonHandle::Tip(
|
||||
const wxMouseState &, AudacityProject &) const
|
||||
const wxMouseState &, AudacityProject &project) const
|
||||
{
|
||||
auto name = XO("Mute");
|
||||
auto project = ::GetActiveProject();
|
||||
auto focused =
|
||||
TrackFocus::Get( *project ).Get() == GetTrack().get();
|
||||
TrackFocus::Get( project ).Get() == GetTrack().get();
|
||||
if (!focused)
|
||||
return name;
|
||||
|
||||
auto &commandManager = CommandManager::Get( *project );
|
||||
auto &commandManager = CommandManager::Get( project );
|
||||
ComponentInterfaceSymbol command{ wxT("TrackMute"), name };
|
||||
return commandManager.DescribeCommandsAndShortcuts(&command, 1u);
|
||||
}
|
||||
@@ -99,16 +98,15 @@ UIHandle::Result SoloButtonHandle::CommitChanges
|
||||
}
|
||||
|
||||
TranslatableString SoloButtonHandle::Tip(
|
||||
const wxMouseState &, AudacityProject &) const
|
||||
const wxMouseState &, AudacityProject &project) const
|
||||
{
|
||||
auto name = XO("Solo");
|
||||
auto project = ::GetActiveProject();
|
||||
auto focused =
|
||||
TrackFocus::Get( *project ).Get() == GetTrack().get();
|
||||
TrackFocus::Get( project ).Get() == GetTrack().get();
|
||||
if (!focused)
|
||||
return name;
|
||||
|
||||
auto &commandManager = CommandManager::Get( *project );
|
||||
auto &commandManager = CommandManager::Get( project );
|
||||
ComponentInterfaceSymbol command{ wxT("TrackSolo"), name };
|
||||
return commandManager.DescribeCommandsAndShortcuts( &command, 1u );
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ protected:
|
||||
|
||||
// Define a message for the status bar and tooltip.
|
||||
virtual TranslatableString Tip(
|
||||
const wxMouseState &state, AudacityProject &) const = 0;
|
||||
const wxMouseState &state, AudacityProject &project) const = 0;
|
||||
|
||||
void Enter(bool forward, AudacityProject *) final override;
|
||||
|
||||
|
||||
@@ -173,16 +173,15 @@ UIHandle::Result CloseButtonHandle::CommitChanges
|
||||
}
|
||||
|
||||
TranslatableString CloseButtonHandle::Tip(
|
||||
const wxMouseState &, AudacityProject &) const
|
||||
const wxMouseState &, AudacityProject &project) const
|
||||
{
|
||||
auto name = XO("Close");
|
||||
auto project = ::GetActiveProject();
|
||||
auto focused =
|
||||
TrackFocus::Get( *project ).Get() == GetTrack().get();
|
||||
TrackFocus::Get( project ).Get() == GetTrack().get();
|
||||
if (!focused)
|
||||
return name;
|
||||
|
||||
auto &commandManager = CommandManager::Get( *project );
|
||||
auto &commandManager = CommandManager::Get( project );
|
||||
ComponentInterfaceSymbol command{ wxT("TrackClose"), name };
|
||||
return commandManager.DescribeCommandsAndShortcuts( &command, 1u );
|
||||
}
|
||||
@@ -234,16 +233,15 @@ UIHandle::Result MenuButtonHandle::CommitChanges
|
||||
}
|
||||
|
||||
TranslatableString MenuButtonHandle::Tip(
|
||||
const wxMouseState &, AudacityProject&) const
|
||||
const wxMouseState &, AudacityProject &project) const
|
||||
{
|
||||
auto name = XO("Open menu...");
|
||||
auto project = ::GetActiveProject();
|
||||
auto focused =
|
||||
TrackFocus::Get( *project ).Get() == GetTrack().get();
|
||||
TrackFocus::Get( project ).Get() == GetTrack().get();
|
||||
if (!focused)
|
||||
return name;
|
||||
|
||||
auto &commandManager = CommandManager::Get( *project );
|
||||
auto &commandManager = CommandManager::Get( project );
|
||||
ComponentInterfaceSymbol command{ wxT("TrackMenu"), name };
|
||||
return commandManager.DescribeCommandsAndShortcuts( &command, 1u );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user