Add a custom dock art provider for aui manager with slight improvement

This commit is contained in:
Marek Roszko 2020-10-18 10:36:17 -04:00
parent 3ced74d19c
commit 29577a571d
5 changed files with 70 additions and 0 deletions

View File

@ -235,6 +235,7 @@ set( COMMON_WIDGET_SRCS
widgets/wx_busy_indicator.cpp
widgets/wx_grid.cpp
widgets/wx_angle_text.cpp
widgets/wx_aui_dock_art.cpp
)
set( COMMON_PAGE_LAYOUT_SRCS

View File

@ -96,6 +96,8 @@ EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* aParent, FRAME_T aFrameType,
m_mruPath = wxStandardPaths::Get().GetDocumentsDir();
m_FrameSize = wxSize( s_minsize_x, s_minsize_y );
m_auimgr.SetArtProvider( &m_auiDockArt );
m_settingsManager = &Pgm().GetSettingsManager();
// Set a reasonable minimal size for the frame

View File

@ -0,0 +1,34 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <wx/aui/framemanager.h>
#include <widgets/wx_aui_dock_art.h>
WX_AUI_DOCK_ART::WX_AUI_DOCK_ART() : wxAuiDefaultDockArt()
{
// Use normal control font, wx likes to use "small"
m_captionFont = *wxNORMAL_FONT;
// Increase the box the caption rests in size a bit
m_captionSize = wxWindow::FromDIP( 25, NULL );
// Turn off the ridiculous looking gradient
m_gradientType = wxAUI_GRADIENT_NONE;
}

View File

@ -47,6 +47,7 @@
#include <kiway_holder.h>
#include <tool/tools_holder.h>
#include <widgets/ui_common.h>
#include <widgets/wx_aui_dock_art.h>
#include <undo_redo_container.h>
// Option for main frames
@ -135,6 +136,7 @@ protected:
wxString m_AboutTitle; // Name of program displayed in About.
WX_AUI_DOCK_ART m_auiDockArt; // Our custom dock art provider we feed to the aui manager
wxAuiManager m_auimgr;
wxString m_perspective; // wxAuiManager perspective.

View File

@ -0,0 +1,31 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef WX_AUI_DOCK_ART_H
#define WX_AUI_DOCK_ART_H
#include <wx/aui/dockart.h>
class WX_AUI_DOCK_ART : public wxAuiDefaultDockArt
{
public:
WX_AUI_DOCK_ART();
};
#endif