3D viewer, main toolbar: fix incorrect parent for 2 widgets.

Also use SHIFT instead of ALT as modifier to show the viewport list, because
ALT is not usable on Windows, especially combined with TAB
This commit is contained in:
jean-pierre charras 2022-07-29 18:31:49 +02:00
parent 490875e222
commit 3245aec5b5
2 changed files with 6 additions and 7 deletions

View File

@ -51,10 +51,11 @@ void EDA_3D_VIEWER_FRAME::ReCreateMainToolbar()
m_mainToolBar->SetAuiManager( &m_auimgr );
}
m_viewportsLabel = new wxStaticText( this, wxID_ANY, _( "Viewports (Alt+Tab):" ) );
// Show the hotkey to open the windows list selector:
m_viewportsLabel = new wxStaticText( m_mainToolBar, wxID_ANY, _( "Viewports (Shift+Tab):" ) );
m_viewportsLabel->Wrap( -1 );
m_cbViewports = new wxChoice( this, wxID_ANY );
m_cbViewports = new wxChoice( m_mainToolBar, wxID_ANY );
for( std::pair<const wxString, VIEWPORT3D>& pair : m_viewports )
m_cbViewports->Append( pair.first, static_cast<void*>( &pair.second ) );

View File

@ -285,11 +285,9 @@ bool EDA_3D_VIEWER_FRAME::TryBefore( wxEvent& aEvent )
{
static bool s_viewportSwitcherShown = false;
#ifdef __WXMAC__
wxKeyCode viewSwitchKey = WXK_ALT;
#else
wxKeyCode viewSwitchKey = WXK_WINDOWS_LEFT;
#endif
// On Windows, the Alt key is not usable, especially with TAB key
// Shift key is OK on all platforms
wxKeyCode viewSwitchKey = WXK_SHIFT;
if( aEvent.GetEventType() != wxEVT_CHAR && aEvent.GetEventType() != wxEVT_CHAR_HOOK )
return wxFrame::TryBefore( aEvent );