Changed AUI toolbars background from gradient to solid

Based on patches from Windsor Schmidt <windsor.schmidt@gmail.com>
This commit is contained in:
Maciej Suminski 2017-09-27 19:40:18 +02:00
parent df830dab4c
commit 068a29952c
15 changed files with 52 additions and 30 deletions

View File

@ -48,7 +48,7 @@ void EDA_3D_VIEWER::ReCreateMainToolbar()
}
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
// Set up toolbar
m_mainToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,

View File

@ -106,6 +106,9 @@ EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* aParent, FRAME_T aFrameType,
// hook wxEVT_CLOSE_WINDOW so we can call SaveSettings(). This function seems
// to be called before any other hook for wxCloseEvent, which is necessary.
Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( EDA_BASE_FRAME::windowClosing ) );
// remove border from wxAui panes for all derived classes
Connect( wxEVT_SHOW, wxShowEventHandler( EDA_BASE_FRAME::removePaneBorder ) );
}
@ -153,6 +156,18 @@ void EDA_BASE_FRAME::windowClosing( wxCloseEvent& event )
}
void EDA_BASE_FRAME::removePaneBorder( wxShowEvent& event )
{
// remove the ugly 1-pixel white border on AUI panes
wxAuiPaneInfoArray panes = m_auimgr.GetAllPanes();
for( size_t i = 0; i < panes.GetCount(); i++ )
m_auimgr.GetPane( panes.Item( i ).name ).PaneBorder( false );
m_auimgr.Update();
}
EDA_BASE_FRAME::~EDA_BASE_FRAME()
{
delete m_autoSaveTimer;

View File

@ -172,7 +172,7 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateOptToolbar()
// Create options tool bar.
m_optionsToolBar = new wxAuiToolBar( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
_( "Hide grid" ), wxITEM_CHECK );
@ -218,7 +218,7 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateHToolbar()
return;
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
m_mainToolBar->AddTool( ID_OPTIONS_SETUP, wxEmptyString, KiBitmap( display_options_xpm ),
_( "Display options" ) );

View File

@ -45,7 +45,7 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
return;
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
m_mainToolBar->AddTool( wxID_SAVE, wxEmptyString, KiBitmap( save_xpm ), SAVE_HLP_MSG );

View File

@ -56,7 +56,7 @@ void LIB_EDIT_FRAME::ReCreateVToolbar()
return;
m_drawToolBar = new wxAuiToolBar( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
// Set up toolbar
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
@ -105,7 +105,7 @@ void LIB_EDIT_FRAME::ReCreateHToolbar()
return;
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
// Set up toolbar
m_mainToolBar->AddTool( ID_LIBEDIT_SELECT_CURRENT_LIB, wxEmptyString, KiBitmap( library_xpm ),
@ -227,7 +227,7 @@ void LIB_EDIT_FRAME::CreateOptionToolbar()
return;
m_optionsToolBar = new wxAuiToolBar( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
_( "Turn grid off" ), wxITEM_CHECK );

View File

@ -49,7 +49,7 @@ void SCH_EDIT_FRAME::ReCreateHToolbar()
wxString msg;
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
// Set up toolbar
if( Kiface().IsSingle() ) // not when under a project mgr
@ -192,7 +192,7 @@ void SCH_EDIT_FRAME::ReCreateVToolbar()
return;
m_drawToolBar = new wxAuiToolBar( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
// Set up toolbar
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
@ -273,7 +273,7 @@ void SCH_EDIT_FRAME::ReCreateOptToolbar()
return;
m_optionsToolBar = new wxAuiToolBar( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString,
KiBitmap( grid_xpm ),

View File

@ -49,7 +49,7 @@ void LIB_VIEW_FRAME::ReCreateHToolbar()
if( m_mainToolBar == NULL )
{
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
m_mainToolBar->AddTool( ID_LIBVIEW_SELECT_PART, wxEmptyString,
KiBitmap( add_component_xpm ),

View File

@ -53,7 +53,7 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void )
return;
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
// Set up toolbar
m_mainToolBar->AddTool( ID_GERBVIEW_ERASE_ALL, wxEmptyString,
@ -142,7 +142,7 @@ void GERBVIEW_FRAME::ReCreateAuxiliaryToolbar()
}
m_auxiliaryToolBar = new wxAuiToolBar( this, ID_AUX_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
// Creates box to display and choose components:
wxStaticText* text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _("Cmp:") );
@ -193,7 +193,7 @@ void GERBVIEW_FRAME::ReCreateVToolbar( void )
return;
m_drawToolBar = new wxAuiToolBar( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
// Set up toolbar
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ) );
@ -209,7 +209,7 @@ void GERBVIEW_FRAME::ReCreateOptToolbar( void )
m_optionsToolBar->Clear();
else
m_optionsToolBar = new wxAuiToolBar( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
// TODO: these can be moved to the 'proper' vertical toolbar if and when there are
// actual tools to put there. That, or I'll get around to implementing configurable

View File

@ -129,6 +129,11 @@ class EDA_BASE_FRAME : public wxFrame
*/
void windowClosing( wxCloseEvent& event );
/**
* Removes border from wxAui panes.
*/
void removePaneBorder( wxShowEvent& event );
protected:
FRAME_T m_Ident; ///< Id Type (pcb, schematic, library..)
wxPoint m_FramePos;
@ -159,6 +164,9 @@ protected:
wxString m_mruPath; ///< Most recently used path.
///> Default style flags used for wxAUI toolbars
static constexpr int KICAD_AUI_TB_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_PLAIN_BACKGROUND;
/**
* Function onAutoSaveTimer
* handles the auto save timer event.

View File

@ -496,7 +496,7 @@ void KICAD_MANAGER_FRAME::RecreateBaseHToolbar()
// Allocate memory for m_mainToolBar
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
// New
m_mainToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,

View File

@ -46,7 +46,7 @@ void PL_EDITOR_FRAME::ReCreateHToolbar( void )
// Standard file commands
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
m_mainToolBar->AddTool( wxID_NEW, wxEmptyString, KiBitmap( new_generic_xpm ),
_( "New page layout design" ) );
@ -161,7 +161,7 @@ void PL_EDITOR_FRAME::ReCreateVToolbar( void )
return;
m_drawToolBar = new wxAuiToolBar( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
// Set up toolbar
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ) );

View File

@ -650,7 +650,7 @@ void FOOTPRINT_WIZARD_FRAME::ReCreateHToolbar()
if( !m_mainToolBar )
{
m_mainToolBar = new wxAuiToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
// Set up toolbar
m_mainToolBar->AddTool( ID_FOOTPRINT_WIZARD_SELECT_WIZARD, wxEmptyString,

View File

@ -48,7 +48,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar()
wxString msg;
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
// Set up toolbar
m_mainToolBar->AddTool( ID_MODEDIT_SELECT_CURRENT_LIB, wxEmptyString,
@ -159,7 +159,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateVToolbar()
return;
m_drawToolBar = new wxAuiToolBar( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
// Set up toolbar
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
@ -212,7 +212,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateOptToolbar()
// Create options tool bar.
m_optionsToolBar = new wxAuiToolBar( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
_( "Hide grid" ), wxITEM_CHECK );
@ -262,7 +262,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateAuxiliaryToolbar()
return;
m_auxiliaryToolBar = new wxAuiToolBar( this, ID_AUX_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
// Set up toolbar
m_auxiliaryToolBar->AddSeparator();

View File

@ -49,7 +49,7 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateHToolbar()
if( m_mainToolBar == NULL )
{
m_mainToolBar = new wxAuiToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT
| wxAUI_TB_OVERFLOW );
// Set up toolbar

View File

@ -209,7 +209,7 @@ void PCB_EDIT_FRAME::ReCreateHToolbar()
wxWindowUpdateLocker dummy( this );
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
// Set up toolbar
if( Kiface().IsSingle() )
@ -330,7 +330,7 @@ void PCB_EDIT_FRAME::ReCreateOptToolbar()
wxWindowUpdateLocker dummy( this );
m_optionsToolBar = new wxAuiToolBar( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
m_optionsToolBar->AddTool( ID_TB_OPTIONS_DRC_OFF, wxEmptyString, KiBitmap( drc_off_xpm ),
_( "Enable design rule checking" ), wxITEM_CHECK );
@ -419,7 +419,7 @@ void PCB_EDIT_FRAME::ReCreateVToolbar()
wxWindowUpdateLocker dummy( this );
m_drawToolBar = new wxAuiToolBar( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
// Set up toolbar
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
@ -505,8 +505,7 @@ void PCB_EDIT_FRAME::ReCreateMicrowaveVToolbar()
wxWindowUpdateLocker dummy(this);
m_microWaveToolBar = new wxAuiToolBar( this, ID_MICROWAVE_V_TOOLBAR, wxDefaultPosition,
wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
wxDefaultSize, KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
// Set up toolbar
m_microWaveToolBar->AddTool( ID_PCB_MUWAVE_TOOL_SELF_CMD, wxEmptyString,
@ -561,7 +560,7 @@ void PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar()
}
m_auxiliaryToolBar = new wxAuiToolBar( this, ID_AUX_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
/* Set up toolbar items */