Remember dialog sizes for dialogs that might have lots of fields.
This is mainly for simulation testing where the dialog has to be grown every time you restart the app, but it might as well be applied to the similar dialogs. Fixes https://gitlab.com/kicad/code/kicad/issues/12887
This commit is contained in:
parent
91dc79169a
commit
13b73ed6b4
|
@ -215,6 +215,9 @@ DIALOG_LABEL_PROPERTIES::DIALOG_LABEL_PROPERTIES( SCH_EDIT_FRAME* aParent, SCH_L
|
|||
|
||||
// Now all widgets have the size fixed, call FinishDialogSettings
|
||||
finishDialogSettings();
|
||||
|
||||
if( cfg && cfg->m_Appearance.edit_label_width > 0 && cfg->m_Appearance.edit_label_height > 0 )
|
||||
SetSize( cfg->m_Appearance.edit_label_width, cfg->m_Appearance.edit_label_height );
|
||||
}
|
||||
|
||||
|
||||
|
@ -224,7 +227,11 @@ DIALOG_LABEL_PROPERTIES::~DIALOG_LABEL_PROPERTIES()
|
|||
wxASSERT( cfg );
|
||||
|
||||
if( cfg )
|
||||
cfg->m_Appearance.edit_sheet_visible_columns = m_grid->GetShownColumns();
|
||||
{
|
||||
cfg->m_Appearance.edit_label_visible_columns = m_grid->GetShownColumns();
|
||||
cfg->m_Appearance.edit_label_width = GetSize().x;
|
||||
cfg->m_Appearance.edit_label_height = GetSize().y;
|
||||
}
|
||||
|
||||
// Prevents crash bug in wxGrid's d'tor
|
||||
m_grid->DestroyTable( m_fields );
|
||||
|
|
|
@ -65,7 +65,7 @@ DIALOG_SHEET_PROPERTIES::DIALOG_SHEET_PROPERTIES( SCH_EDIT_FRAME* aParent, SCH_S
|
|||
m_grid->SetSelectionMode( wxGrid::wxGridSelectRows );
|
||||
|
||||
// Show/hide columns according to user's preference
|
||||
auto cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
|
||||
EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
|
||||
wxASSERT( cfg );
|
||||
|
||||
if( cfg )
|
||||
|
@ -99,18 +99,20 @@ DIALOG_SHEET_PROPERTIES::DIALOG_SHEET_PROPERTIES( SCH_EDIT_FRAME* aParent, SCH_S
|
|||
m_grid->Connect( wxEVT_GRID_CELL_CHANGING,
|
||||
wxGridEventHandler( DIALOG_SHEET_PROPERTIES::OnGridCellChanging ),
|
||||
nullptr, this );
|
||||
|
||||
finishDialogSettings();
|
||||
}
|
||||
|
||||
|
||||
DIALOG_SHEET_PROPERTIES::~DIALOG_SHEET_PROPERTIES()
|
||||
{
|
||||
auto cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
|
||||
EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
|
||||
wxASSERT( cfg );
|
||||
|
||||
if( cfg )
|
||||
{
|
||||
cfg->m_Appearance.edit_sheet_visible_columns = m_grid->GetShownColumns();
|
||||
cfg->m_Appearance.edit_sheet_width = GetSize().x;
|
||||
cfg->m_Appearance.edit_sheet_height = GetSize().y;
|
||||
}
|
||||
|
||||
// Prevents crash bug in wxGrid's d'tor
|
||||
m_grid->DestroyTable( m_fields );
|
||||
|
@ -181,8 +183,6 @@ bool DIALOG_SHEET_PROPERTIES::TransferDataToWindow()
|
|||
|
||||
m_pageNumberTextCtrl->ChangeValue( nextPageNumber );
|
||||
|
||||
Layout();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -914,4 +914,10 @@ void DIALOG_SHEET_PROPERTIES::OnInitDlg( wxInitDialogEvent& event )
|
|||
|
||||
// Now all widgets have the size fixed, call FinishDialogSettings
|
||||
finishDialogSettings();
|
||||
|
||||
EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
|
||||
|
||||
if( cfg && cfg->m_Appearance.edit_sheet_width > 0 && cfg->m_Appearance.edit_sheet_height > 0 )
|
||||
SetSize( cfg->m_Appearance.edit_sheet_width, cfg->m_Appearance.edit_sheet_height );
|
||||
|
||||
}
|
||||
|
|
|
@ -401,7 +401,11 @@ DIALOG_SYMBOL_PROPERTIES::~DIALOG_SYMBOL_PROPERTIES()
|
|||
EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
|
||||
|
||||
if( cfg )
|
||||
{
|
||||
cfg->m_Appearance.edit_symbol_visible_columns = m_fieldsGrid->GetShownColumns();
|
||||
cfg->m_Appearance.edit_symbol_width = GetSize().x;
|
||||
cfg->m_Appearance.edit_symbol_height = GetSize().y;
|
||||
}
|
||||
|
||||
// Prevents crash bug in wxGrid's d'tor
|
||||
m_fieldsGrid->DestroyTable( m_fields );
|
||||
|
@ -1209,6 +1213,11 @@ void DIALOG_SYMBOL_PROPERTIES::OnInitDlg( wxInitDialogEvent& event )
|
|||
|
||||
// Now all widgets have the size fixed, call FinishDialogSettings
|
||||
finishDialogSettings();
|
||||
|
||||
EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
|
||||
|
||||
if( cfg && cfg->m_Appearance.edit_symbol_width > 0 && cfg->m_Appearance.edit_symbol_height > 0 )
|
||||
SetSize( cfg->m_Appearance.edit_symbol_width, cfg->m_Appearance.edit_symbol_height );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -82,12 +82,30 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() :
|
|||
m_params.emplace_back( new PARAM<wxString>( "appearance.edit_symbol_visible_columns",
|
||||
&m_Appearance.edit_symbol_visible_columns, "0 1 2 3 4 5 6 7" ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "appearance.edit_symbol_width",
|
||||
&m_Appearance.edit_symbol_width, -1 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "appearance.edit_symbol_height",
|
||||
&m_Appearance.edit_symbol_height, -1 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<wxString>( "appearance.edit_sheet_visible_columns",
|
||||
&m_Appearance.edit_sheet_visible_columns, "0 1 2 3 4 5 6 7" ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "appearance.edit_sheet_width",
|
||||
&m_Appearance.edit_sheet_width, -1 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "appearance.edit_sheet_height",
|
||||
&m_Appearance.edit_sheet_height, -1 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<wxString>( "appearance.edit_label_visible_columns",
|
||||
&m_Appearance.edit_label_visible_columns, "0 1 2 3 4 5 6 7" ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "appearance.edit_label_width",
|
||||
&m_Appearance.edit_label_width, -1 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "appearance.edit_label_height",
|
||||
&m_Appearance.edit_label_height, -1 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "appearance.erc_severities",
|
||||
&m_Appearance.erc_severities, RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING ) );
|
||||
|
||||
|
|
|
@ -46,8 +46,14 @@ public:
|
|||
struct APPEARANCE
|
||||
{
|
||||
wxString edit_symbol_visible_columns;
|
||||
int edit_symbol_width;
|
||||
int edit_symbol_height;
|
||||
wxString edit_sheet_visible_columns;
|
||||
int edit_sheet_width;
|
||||
int edit_sheet_height;
|
||||
wxString edit_label_visible_columns;
|
||||
int edit_label_width;
|
||||
int edit_label_height;
|
||||
int erc_severities;
|
||||
bool footprint_preview;
|
||||
bool print_sheet_reference;
|
||||
|
|
Loading…
Reference in New Issue