Don't bind to Alt+Tab
The Alt key is not usable by programs under Windows and Alt+Tab is reserved on both MSW and Linux. Instead, we use the Shift modifier to determine which preset to open
This commit is contained in:
parent
04c46a8fd2
commit
4a16c603e9
|
@ -96,42 +96,52 @@ bool PCB_BASE_EDIT_FRAME::TryBefore( wxEvent& aEvent )
|
|||
static bool s_presetSwitcherShown = false;
|
||||
static bool s_viewportSwitcherShown = false;
|
||||
|
||||
if( !s_presetSwitcherShown && wxGetKeyState( WXK_RAW_CONTROL ) && wxGetKeyState( WXK_TAB ) )
|
||||
if( !s_presetSwitcherShown && wxGetKeyState( WXK_RAW_CONTROL ) && !wxGetKeyState( WXK_SHIFT )
|
||||
&& wxGetKeyState( WXK_TAB ) )
|
||||
{
|
||||
if( m_appearancePanel && this->IsActive() )
|
||||
{
|
||||
const wxArrayString& mru = m_appearancePanel->GetLayerPresetsMRU();
|
||||
EDA_VIEW_SWITCHER switcher( this, mru, WXK_RAW_CONTROL );
|
||||
|
||||
s_presetSwitcherShown = true;
|
||||
switcher.ShowModal();
|
||||
s_presetSwitcherShown = false;
|
||||
if( mru.size() > 1 )
|
||||
{
|
||||
EDA_VIEW_SWITCHER switcher( this, mru, WXK_RAW_CONTROL );
|
||||
|
||||
int idx = switcher.GetSelection();
|
||||
s_presetSwitcherShown = true;
|
||||
switcher.ShowModal();
|
||||
s_presetSwitcherShown = false;
|
||||
|
||||
if( idx >= 0 && idx < (int) mru.size() )
|
||||
m_appearancePanel->ApplyLayerPreset( mru[idx] );
|
||||
int idx = switcher.GetSelection();
|
||||
|
||||
return true;
|
||||
if( idx >= 0 && idx < (int) mru.size() )
|
||||
m_appearancePanel->ApplyLayerPreset( mru[idx] );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( !s_viewportSwitcherShown && wxGetKeyState( WXK_ALT ) && wxGetKeyState( WXK_TAB ) )
|
||||
else if( !s_viewportSwitcherShown && wxGetKeyState( WXK_RAW_CONTROL )
|
||||
&& wxGetKeyState( WXK_SHIFT ) && wxGetKeyState( WXK_TAB ) )
|
||||
{
|
||||
if( m_appearancePanel && this->IsActive() )
|
||||
{
|
||||
const wxArrayString& mru = m_appearancePanel->GetViewportsMRU();
|
||||
EDA_VIEW_SWITCHER switcher( this, mru, WXK_ALT );
|
||||
|
||||
s_viewportSwitcherShown = true;
|
||||
switcher.ShowModal();
|
||||
s_viewportSwitcherShown = false;
|
||||
if( mru.size() > 1 )
|
||||
{
|
||||
EDA_VIEW_SWITCHER switcher( this, mru, WXK_RAW_CONTROL );
|
||||
|
||||
int idx = switcher.GetSelection();
|
||||
s_viewportSwitcherShown = true;
|
||||
switcher.ShowModal();
|
||||
s_viewportSwitcherShown = false;
|
||||
|
||||
if( idx >= 0 && idx < (int) mru.size() )
|
||||
m_appearancePanel->ApplyViewport( mru[idx] );
|
||||
int idx = switcher.GetSelection();
|
||||
|
||||
return true;
|
||||
if( idx >= 0 && idx < (int) mru.size() )
|
||||
m_appearancePanel->ApplyViewport( mru[idx] );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue