mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-21 06:40:08 +02:00
Fixes for ControlToolBar tooltips with keyboard shortcuts not working correctly in some languages, and for tooltips being updated without having to exit and restart.
This commit is contained in:
parent
8ae5acb310
commit
c52f2d3b12
@ -94,6 +94,7 @@ ControlToolBar::ControlToolBar()
|
||||
mCutPreviewTracks = NULL;
|
||||
|
||||
gPrefs->Read(wxT("/GUI/ErgonomicTransportButtons"), &mErgonomicTransportButtons, true);
|
||||
mStrLocale = gPrefs->Read(wxT("/Locale/Language"), wxT(""));
|
||||
}
|
||||
|
||||
ControlToolBar::~ControlToolBar()
|
||||
@ -217,23 +218,27 @@ void ControlToolBar::RegenerateToolsTooltips()
|
||||
switch (iWinID)
|
||||
{
|
||||
case ID_PLAY_BUTTON:
|
||||
strKey += pCmdMgr->GetKeyFromName(strToolTip);
|
||||
strKey += pCmdMgr->GetKeyFromName(wxT("Play"));
|
||||
strKey += _(") / Loop Play (");
|
||||
strKey += pCmdMgr->GetKeyFromName(wxT("PlayLooped"));
|
||||
break;
|
||||
case ID_RECORD_BUTTON:
|
||||
strKey += pCmdMgr->GetKeyFromName(strToolTip);
|
||||
strKey += pCmdMgr->GetKeyFromName(wxT("Record"));
|
||||
strKey += _(") / Append Record (");
|
||||
strKey += pCmdMgr->GetKeyFromName(wxT("RecordAppend"));
|
||||
break;
|
||||
case ID_PAUSE_BUTTON:
|
||||
strKey += pCmdMgr->GetKeyFromName(wxT("Pause"));
|
||||
break;
|
||||
case ID_STOP_BUTTON:
|
||||
strKey += pCmdMgr->GetKeyFromName(wxT("Stop"));
|
||||
break;
|
||||
case ID_FF_BUTTON:
|
||||
strKey += pCmdMgr->GetKeyFromName(wxT("SkipEnd"));
|
||||
break;
|
||||
case ID_REW_BUTTON:
|
||||
strKey += pCmdMgr->GetKeyFromName(wxT("SkipStart"));
|
||||
break;
|
||||
default:
|
||||
strKey += pCmdMgr->GetKeyFromName(strToolTip);
|
||||
}
|
||||
strKey += wxT(")");
|
||||
strToolTip += strKey;
|
||||
@ -248,20 +253,30 @@ void ControlToolBar::UpdatePrefs()
|
||||
bool updated = false;
|
||||
bool active;
|
||||
|
||||
RegenerateToolsTooltips();
|
||||
|
||||
gPrefs->Read( wxT("/GUI/ErgonomicTransportButtons"), &active, true );
|
||||
if( mErgonomicTransportButtons != active )
|
||||
{
|
||||
mErgonomicTransportButtons = active;
|
||||
updated = true;
|
||||
}
|
||||
wxString strLocale = gPrefs->Read(wxT("/Locale/Language"), wxT(""));
|
||||
if (mStrLocale != strLocale)
|
||||
{
|
||||
mStrLocale = strLocale;
|
||||
updated = true;
|
||||
}
|
||||
|
||||
if( updated )
|
||||
{
|
||||
ReCreateButtons();
|
||||
ReCreateButtons(); // side effect: calls RegenerateToolsTooltips()
|
||||
Updated();
|
||||
}
|
||||
else
|
||||
// The other reason to regenerate tooltips is if keyboard shortcuts for
|
||||
// transport buttons changed, but that's too much work to check for, so just
|
||||
// always do it. (Much cheaper than calling ReCreateButtons() in all cases.
|
||||
RegenerateToolsTooltips();
|
||||
|
||||
|
||||
// Set label to pull in language change
|
||||
SetLabel(_("Transport"));
|
||||
|
@ -123,6 +123,8 @@ class ControlToolBar:public ToolBar {
|
||||
// Activate ergonomic order for transport buttons
|
||||
bool mErgonomicTransportButtons;
|
||||
|
||||
wxString mStrLocale; // standard locale abbreviation
|
||||
|
||||
//wxBoxSizer *mBatchGroup;
|
||||
wxBoxSizer *mSizer;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user