1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-06 14:52:34 +02:00

Add some Right-To-Left language workarounds.

MixerBoard, LyricsWindow, Screenshot and most effects are now LTR in RTL locales.
Also added a pref so this can be overridden.  As RTL affects window creation, the language choice and this preference may only fully take effect after a restart of Audacity.
This commit is contained in:
James Crook 2018-08-10 15:35:06 +01:00
parent c95532012a
commit 7f96f85676
6 changed files with 21 additions and 0 deletions

View File

@ -229,4 +229,15 @@ void QuitAudacity();
// pointer like std::unique_ptr or std::shared_ptr.
#define safenew new
// Right to left languages fail in many wx3 dialogs with missing buttons.
// The workaround is to use LTR in those dialogs.
#ifndef __WXMAC__
#define RTL_WORKAROUND( pWnd ) \
if ( gPrefs->Read( "/GUI/RtlWorkaround", true) ) \
pWnd->SetLayoutDirection(wxLayout_LeftToRight);
#else
#define RTL_WORKAROUND( pWnd )
#endif
#endif // __AUDACITY_H__

View File

@ -114,6 +114,8 @@ LyricsWindow::LyricsWindow(AudacityProject *parent):
//pToolBar->Realize();
mLyricsPanel = safenew LyricsPanel(this, -1, panelPos, panelSize);
RTL_WORKAROUND(mLyricsPanel);
//vvv Highlight style is broken in ported version.
//switch (mLyricsPanel->GetLyricsStyle())

View File

@ -912,6 +912,7 @@ MixerBoard::MixerBoard(AudacityProject* pProject,
// mScrolledWindow->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW));
// #endif
mScrolledWindow->SetBackgroundColour( theTheme.Colour( clrMedium ) );
RTL_WORKAROUND(mScrolledWindow);
mScrolledWindow->SetScrollRate(10, 0); // no vertical scroll
mScrolledWindow->SetVirtualSize(size);

View File

@ -308,6 +308,7 @@ void ScreenFrame::Populate()
void ScreenFrame::PopulateOrExchange(ShuttleGui & S)
{
wxPanel *p = S.StartPanel();
RTL_WORKAROUND(p);
{
S.SetBorder(3);

View File

@ -2973,6 +2973,7 @@ int EffectUIHost::ShowModal()
bool EffectUIHost::Initialize()
{
EffectPanel *w = safenew EffectPanel(this);
RTL_WORKAROUND(w);
{
auto vs = std::make_unique<wxBoxSizer>(wxVERTICAL);
{

View File

@ -197,6 +197,11 @@ void GUIPrefs::PopulateOrExchange(ShuttleGui & S)
S.TieCheckBox(_("B&lend system and Audacity theme"),
wxT("/GUI/BlendThemes"),
true);
#ifndef __WXMAC__
S.TieCheckBox(_("Use mostly Left-to-Right layouts in RTL languages"),
"/GUI/RtlWorkaround",
true);
#endif
}
S.EndStatic();