Wayne Stambaugh 4 years ago
parent
commit
d634b33c34
  1. 16
      common/dialogs/panel_color_settings_base.cpp
  2. 1033
      common/dialogs/panel_color_settings_base.fbp
  3. 10
      common/dialogs/panel_color_settings_base.h
  4. 2
      pcbnew/dialogs/panel_fp_editor_color_settings.cpp
  5. 13
      pcbnew/dialogs/panel_pcbnew_color_settings.cpp

16
common/dialogs/panel_color_settings_base.cpp

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
@ -18,14 +18,14 @@ PANEL_COLOR_SETTINGS_BASE::PANEL_COLOR_SETTINGS_BASE( wxWindow* parent, wxWindow
m_staticText9 = new wxStaticText( this, wxID_ANY, _("Theme:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText9 = new wxStaticText( this, wxID_ANY, _("Theme:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText9->Wrap( -1 ); m_staticText9->Wrap( -1 );
bControlSizer->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
bControlSizer->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
wxArrayString m_cbThemeChoices; wxArrayString m_cbThemeChoices;
m_cbTheme = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_cbThemeChoices, 0 ); m_cbTheme = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_cbThemeChoices, 0 );
m_cbTheme->SetSelection( 0 ); m_cbTheme->SetSelection( 0 );
m_cbTheme->SetMinSize( wxSize( 150,-1 ) ); m_cbTheme->SetMinSize( wxSize( 150,-1 ) );
bControlSizer->Add( m_cbTheme, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
bControlSizer->Add( m_cbTheme, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxTOP, 5 );
bControlSizer->Add( 0, 0, 1, wxEXPAND, 5 ); bControlSizer->Add( 0, 0, 1, wxEXPAND, 5 );
@ -33,7 +33,7 @@ PANEL_COLOR_SETTINGS_BASE::PANEL_COLOR_SETTINGS_BASE( wxWindow* parent, wxWindow
m_optOverrideColors = new wxCheckBox( this, wxID_ANY, _("Override individual item colors"), wxDefaultPosition, wxDefaultSize, 0 ); m_optOverrideColors = new wxCheckBox( this, wxID_ANY, _("Override individual item colors"), wxDefaultPosition, wxDefaultSize, 0 );
m_optOverrideColors->SetToolTip( _("Show all items in their default color even if they have specific colors set in their properties.") ); m_optOverrideColors->SetToolTip( _("Show all items in their default color even if they have specific colors set in their properties.") );
bControlSizer->Add( m_optOverrideColors, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
bControlSizer->Add( m_optOverrideColors, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
bControlSizer->Add( 0, 0, 1, wxEXPAND, 5 ); bControlSizer->Add( 0, 0, 1, wxEXPAND, 5 );
@ -41,7 +41,7 @@ PANEL_COLOR_SETTINGS_BASE::PANEL_COLOR_SETTINGS_BASE( wxWindow* parent, wxWindow
m_btnOpenFolder = new wxButton( this, wxID_ANY, _("Open Theme Folder"), wxDefaultPosition, wxDefaultSize, 0 ); m_btnOpenFolder = new wxButton( this, wxID_ANY, _("Open Theme Folder"), wxDefaultPosition, wxDefaultSize, 0 );
m_btnOpenFolder->SetToolTip( _("Open the folder containing color themes") ); m_btnOpenFolder->SetToolTip( _("Open the folder containing color themes") );
bControlSizer->Add( m_btnOpenFolder, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
bControlSizer->Add( m_btnOpenFolder, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_mainSizer->Add( bControlSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); m_mainSizer->Add( bControlSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
@ -74,12 +74,18 @@ PANEL_COLOR_SETTINGS_BASE::PANEL_COLOR_SETTINGS_BASE( wxWindow* parent, wxWindow
m_colorsMainSizer->Add( bottomMargin, 0, wxEXPAND|wxBOTTOM, 3 ); m_colorsMainSizer->Add( bottomMargin, 0, wxEXPAND|wxBOTTOM, 3 );
m_previewPanelSizer = new wxBoxSizer( wxVERTICAL );
m_colorsMainSizer->Add( m_previewPanelSizer, 1, wxEXPAND, 5 );
m_mainSizer->Add( m_colorsMainSizer, 1, wxEXPAND|wxLEFT, 5 ); m_mainSizer->Add( m_colorsMainSizer, 1, wxEXPAND|wxLEFT, 5 );
this->SetSizer( m_mainSizer ); this->SetSizer( m_mainSizer );
this->Layout(); this->Layout();
m_mainSizer->Fit( this );
// Connect Events // Connect Events
this->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_COLOR_SETTINGS_BASE::OnSize ) ); this->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_COLOR_SETTINGS_BASE::OnSize ) );

1033
common/dialogs/panel_color_settings_base.fbp
File diff suppressed because it is too large
View File

10
common/dialogs/panel_color_settings_base.h

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
@ -19,10 +19,10 @@
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/choice.h> #include <wx/choice.h>
#include <wx/checkbox.h> #include <wx/checkbox.h>
#include <wx/button.h>
#include <wx/bitmap.h> #include <wx/bitmap.h>
#include <wx/image.h> #include <wx/image.h>
#include <wx/icon.h> #include <wx/icon.h>
#include <wx/button.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/statline.h> #include <wx/statline.h>
#include <wx/scrolwin.h> #include <wx/scrolwin.h>
@ -46,8 +46,9 @@ class PANEL_COLOR_SETTINGS_BASE : public RESETTABLE_PANEL
wxBoxSizer* m_colorsMainSizer; wxBoxSizer* m_colorsMainSizer;
wxScrolledWindow* m_colorsListWindow; wxScrolledWindow* m_colorsListWindow;
wxFlexGridSizer* m_colorsGridSizer; wxFlexGridSizer* m_colorsGridSizer;
wxBoxSizer* m_previewPanelSizer;
// Virtual event handlers, overide them in your derived class
// Virtual event handlers, override them in your derived class
virtual void OnSize( wxSizeEvent& event ) { event.Skip(); } virtual void OnSize( wxSizeEvent& event ) { event.Skip(); }
virtual void OnThemeChanged( wxCommandEvent& event ) { event.Skip(); } virtual void OnThemeChanged( wxCommandEvent& event ) { event.Skip(); }
virtual void OnLeftDownTheme( wxMouseEvent& event ) { event.Skip(); } virtual void OnLeftDownTheme( wxMouseEvent& event ) { event.Skip(); }
@ -58,7 +59,8 @@ class PANEL_COLOR_SETTINGS_BASE : public RESETTABLE_PANEL
public: public:
wxCheckBox* m_optOverrideColors; wxCheckBox* m_optOverrideColors;
PANEL_COLOR_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 826,300 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
PANEL_COLOR_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_COLOR_SETTINGS_BASE(); ~PANEL_COLOR_SETTINGS_BASE();
}; };

2
pcbnew/dialogs/panel_fp_editor_color_settings.cpp

@ -125,4 +125,6 @@ void PANEL_FP_EDITOR_COLOR_SETTINGS::createSwatches()
for( GAL_LAYER_ID layer : galLayers ) for( GAL_LAYER_ID layer : galLayers )
createSwatch( layer, LayerName( layer ) ); createSwatch( layer, LayerName( layer ) );
Layout();
} }

13
pcbnew/dialogs/panel_pcbnew_color_settings.cpp

@ -454,22 +454,13 @@ void PANEL_PCBNEW_COLOR_SETTINGS::createSwatches()
createSwatch( layer, name ); createSwatch( layer, name );
} }
// Give a minimal width to m_colorsListWindow, in order to always having
// a full row shown
int min_width = m_colorsGridSizer->GetMinSize().x;
const int margin = 20; // A margin around the sizer
m_colorsListWindow->SetMinSize( wxSize( min_width + margin, -1 ) );
m_colorsMainSizer->Insert( 0, 10, 0, 0, wxEXPAND, 5 );
m_preview = FOOTPRINT_PREVIEW_PANEL::New( nullptr, this ); m_preview = FOOTPRINT_PREVIEW_PANEL::New( nullptr, this );
m_preview->GetGAL()->SetAxesEnabled( false ); m_preview->GetGAL()->SetAxesEnabled( false );
m_colorsMainSizer->Add( 10, 0, 0, wxEXPAND, 5 );
m_colorsMainSizer->Add( m_preview, 1, wxALL | wxEXPAND, 5 );
m_colorsMainSizer->Add( 10, 0, 0, wxEXPAND, 5 );
m_previewPanelSizer->Add( m_preview, 1, wxALL | wxEXPAND, 5 );
createPreviewItems(); createPreviewItems();
Layout();
updatePreview(); updatePreview();
zoomFitPreview(); zoomFitPreview();
} }

Loading…
Cancel
Save