A few tweaks for hidpi

This commit is contained in:
Marek Roszko 2024-02-05 00:52:11 -05:00
parent 11f76c129e
commit 3960c53225
8 changed files with 24 additions and 7 deletions

View File

@ -53,6 +53,9 @@ PANEL_COLOR_SETTINGS::PANEL_COLOR_SETTINGS( wxWindow* aParent ) :
m_colorsListWindow->SetWindowStyle( wxBORDER_SUNKEN|wxVSCROLL );
#endif
m_cbTheme->SetMinSize( FromDIP( m_cbTheme->GetMinSize() ) );
m_colorsListWindow->SetMinSize( FromDIP( m_colorsListWindow->GetMinSize() ) );
m_colorsGridSizer->SetMinSize( FromDIP( m_colorsGridSizer->GetMinSize() ) );
m_panel1->SetBorders( false, false, true, false );
}

View File

@ -46,6 +46,7 @@ PANEL_GRID_SETTINGS::PANEL_GRID_SETTINGS( wxWindow* aParent, UNITS_PROVIDER* aUn
m_frameType( aFrameType ),
m_eventSource( aEventSource )
{
m_currentGridCtrl->SetMinSize( FromDIP( m_currentGridCtrl->GetMinSize() ) );
RebuildGridSizes();
if( m_frameType == FRAME_PCB_EDITOR || m_frameType == FRAME_FOOTPRINT_EDITOR )

View File

@ -108,7 +108,11 @@ PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( wxWindow* aParentWindow, EDA_DRA
// Prevent Size events from firing before we are ready
Freeze();
m_netclassGrid->BeginBatch();
m_netclassGrid->SetUseNativeColLabels();
m_assignmentGrid->BeginBatch();
m_assignmentGrid->SetUseNativeColLabels();
m_splitter->SetMinimumPaneSize( FromDIP( m_splitter->GetMinimumPaneSize() ) );
m_originalColWidths = new int[ m_netclassGrid->GetNumberCols() ];
// Calculate a min best size to handle longest usual numeric values:

View File

@ -1096,6 +1096,7 @@ DIALOG_NET_INSPECTOR::DIALOG_NET_INSPECTOR( PCB_EDIT_FRAME* aParent ) :
wxDATAVIEW_COL_SORTABLE );
}
m_netsList->SetMinSize( FromDIP( m_netsList->GetMinSize() ) );
m_netsList->SetExpanderColumn( m_netsList->GetColumn( 0 ) );
// avoid onFilterChange for each of the settings as it will re-build the

View File

@ -74,8 +74,10 @@ DIALOG_SWAP_LAYERS::DIALOG_SWAP_LAYERS( PCB_BASE_EDIT_FRAME* aParent, PCB_LAYER_
{
m_gridTable = new LAYER_GRID_TABLE( m_parent->GetBoard()->GetCopperLayerCount() );
m_grid->SetTable( m_gridTable );
m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + 4 );
m_grid->SetMinSize( FromDIP( m_grid->GetMinSize() ) );
m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + FromDIP( 4 ) );
m_grid->SetCellHighlightROPenWidth( 0 );
m_grid->SetUseNativeColLabels();
SetupStandardButtons();
@ -146,8 +148,8 @@ void DIALOG_SWAP_LAYERS::adjustGridColumns()
// Account for scroll bars
int width = KIPLATFORM::UI::GetUnobscuredSize( m_grid ).x;
m_grid->SetColSize( 0, std::max( 40, width / 2 ) );
m_grid->SetColSize( 1, std::max( 40, width - m_grid->GetColSize( 0 ) ) );
m_grid->SetColSize( 0, std::max( FromDIP( 40 ), width / 2 ) );
m_grid->SetColSize( 1, std::max( FromDIP( 40 ), width - m_grid->GetColSize( 0 ) ) );
}

View File

@ -41,6 +41,7 @@ PANEL_PCBNEW_ACTION_PLUGINS::PANEL_PCBNEW_ACTION_PLUGINS( wxWindow* aParent ) :
{
m_genericIcon = KiBitmap( BITMAPS::puzzle_piece );
m_grid->PushEventHandler( new GRID_TRICKS( m_grid ) );
m_grid->SetUseNativeColLabels();
m_moveUpButton->SetBitmap( KiBitmapBundle( BITMAPS::small_up ) );
m_moveDownButton->SetBitmap( KiBitmapBundle( BITMAPS::small_down ) );

View File

@ -71,7 +71,8 @@ PANEL_SETUP_TEXT_AND_GRAPHICS::PANEL_SETUP_TEXT_AND_GRAPHICS( wxWindow* aParentW
COL_TEXT_WIDTH,
COL_TEXT_HEIGHT,
COL_TEXT_THICKNESS } );
m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + 4 );
m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + FromDIP( 4 ) );
m_grid->SetUseNativeColLabels();
// Work around a bug in wxWidgets where it fails to recalculate the grid height
// after changing the default row size

View File

@ -71,9 +71,9 @@ PANEL_SETUP_TRACKS_AND_VIAS::PANEL_SETUP_TRACKS_AND_VIAS( wxWindow* aParentWindo
// Membership combobox editors require a bit more room, so increase the row size of
// all our grids for consistency
m_trackWidthsGrid->SetDefaultRowSize( m_trackWidthsGrid->GetDefaultRowSize() + 4 );
m_viaSizesGrid->SetDefaultRowSize( m_viaSizesGrid->GetDefaultRowSize() + 4 );
m_diffPairsGrid->SetDefaultRowSize( m_diffPairsGrid->GetDefaultRowSize() + 4 );
m_trackWidthsGrid->SetDefaultRowSize( m_trackWidthsGrid->GetDefaultRowSize() + FromDIP( 4 ) );
m_viaSizesGrid->SetDefaultRowSize( m_viaSizesGrid->GetDefaultRowSize() + FromDIP( 4 ) );
m_diffPairsGrid->SetDefaultRowSize( m_diffPairsGrid->GetDefaultRowSize() + FromDIP( 4 ) );
m_trackWidthsGrid->PushEventHandler( new GRID_TRICKS( m_trackWidthsGrid,
[this]( wxCommandEvent& aEvent )
@ -103,6 +103,10 @@ PANEL_SETUP_TRACKS_AND_VIAS::PANEL_SETUP_TRACKS_AND_VIAS( wxWindow* aParentWindo
m_viaSizesGrid->SetAutoEvalCols( { 0, 1 } );
m_diffPairsGrid->SetAutoEvalCols( { 0, 1, 2 } );
m_trackWidthsGrid->SetUseNativeColLabels();
m_viaSizesGrid->SetUseNativeColLabels();
m_diffPairsGrid->SetUseNativeColLabels();
// Ensure width of columns is enough to enter any reasonable value
WX_GRID* grid_list[] = { m_trackWidthsGrid, m_viaSizesGrid, m_diffPairsGrid, nullptr };
int min_linesize = m_trackWidthsGrid->GetTextExtent( wxT( "000.000000 mm " ) ).x;