mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 16:10:06 +02:00
AButton::SetToolTip takes TranslatableString
This commit is contained in:
parent
681950fc61
commit
e875adaa6f
@ -313,8 +313,8 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent,
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
mStaticText_TrackName->SetToolTip(mTrack->GetName());
|
||||
mToggleButton_Mute->SetToolTip(_("Mute"));
|
||||
mToggleButton_Solo->SetToolTip(_("Solo"));
|
||||
mToggleButton_Mute->SetToolTip(XO("Mute"));
|
||||
mToggleButton_Solo->SetToolTip(XO("Solo"));
|
||||
if (GetWave())
|
||||
mMeter->SetToolTip(XO("Signal Level Meter"));
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
@ -869,7 +869,7 @@ void ToolBar::SetButtonToolTip
|
||||
if (commandManager)
|
||||
result =
|
||||
commandManager->DescribeCommandsAndShortcuts(commands, nCommands);
|
||||
button.SetToolTip(result);
|
||||
button.SetToolTip( TranslatableString{ result } );
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -285,6 +285,11 @@ void AButton::UseDisabledAsDownHiliteImage(bool flag)
|
||||
mUseDisabledAsDownHiliteImage = flag;
|
||||
}
|
||||
|
||||
void AButton::SetToolTip( TranslatableString toolTip )
|
||||
{
|
||||
wxWindow::SetToolTip( toolTip.Strip().Translation() );
|
||||
}
|
||||
|
||||
// This compensates for a but in wxWidgets 3.0.2 for mac:
|
||||
// Couldn't set focus from keyboard when AcceptsFocus returns false;
|
||||
// this bypasses that limitation
|
||||
@ -445,7 +450,7 @@ void AButton::OnMouseEvent(wxMouseEvent & event)
|
||||
// to make it pop up when we want it.
|
||||
auto text = GetToolTipText();
|
||||
UnsetToolTip();
|
||||
SetToolTip(text);
|
||||
wxWindow::SetToolTip(text);
|
||||
mCursorIsInWindow = true;
|
||||
}
|
||||
else if (event.Leaving())
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "ImageRoll.h" // member variable
|
||||
|
||||
class wxImage;
|
||||
class TranslatableString;
|
||||
|
||||
class AButton final : public wxWindow {
|
||||
friend class AButtonAx;
|
||||
@ -55,6 +56,9 @@ class AButton final : public wxWindow {
|
||||
|
||||
virtual ~ AButton();
|
||||
|
||||
// overload and hide the inherited function that takes naked wxString:
|
||||
void SetToolTip(TranslatableString toolTip);
|
||||
|
||||
bool AcceptsFocus() const override { return s_AcceptsFocus; }
|
||||
bool AcceptsFocusFromKeyboard() const override { return mEnabled; }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user