Smooth out a few minor inconsistencies in fonts & spacings.

This commit is contained in:
Jeff Young 2021-09-12 17:56:49 +01:00
parent b38592b1f6
commit 62f7a09290
3 changed files with 46 additions and 64 deletions

View File

@ -149,15 +149,10 @@ wxString NET_GRID_TABLE::GetTypeName( int aRow, int aCol )
{ {
switch( aCol ) switch( aCol )
{ {
case COL_COLOR: case COL_COLOR: return wxT( "COLOR4D" );
return wxT( "COLOR4D" ); case COL_VISIBILITY: return wxGRID_VALUE_BOOL;
case COL_LABEL: return wxGRID_VALUE_STRING;
case COL_VISIBILITY: default: return wxGRID_VALUE_STRING;
return wxGRID_VALUE_BOOL;
case COL_LABEL:
default:
return wxGRID_VALUE_STRING;
} }
} }
@ -435,8 +430,6 @@ APPEARANCE_CONTROLS::APPEARANCE_CONTROLS( PCB_BASE_FRAME* aParent, wxWindow* aFo
m_panelLayers->SetFont( infoFont ); m_panelLayers->SetFont( infoFont );
m_windowLayers->SetFont( infoFont ); m_windowLayers->SetFont( infoFont );
m_windowObjects->SetFont( infoFont ); m_windowObjects->SetFont( infoFont );
infoFont = KIUI::GetStatusFont( this );
m_presetsLabel->SetFont( infoFont ); m_presetsLabel->SetFont( infoFont );
m_presetsHotkey->SetFont( infoFont ); m_presetsHotkey->SetFont( infoFont );
@ -902,10 +895,14 @@ void APPEARANCE_CONTROLS::OnNetGridMouseEvent( wxMouseEvent& aEvent )
wxString tip; wxString tip;
if( cell.GetCol() == NET_GRID_TABLE::COL_VISIBILITY ) if( cell.GetCol() == NET_GRID_TABLE::COL_VISIBILITY )
{
tip.Printf( showOrHide, name ); tip.Printf( showOrHide, name );
}
else if( cell.GetCol() == NET_GRID_TABLE::COL_COLOR ) else if( cell.GetCol() == NET_GRID_TABLE::COL_COLOR )
{
tip = _( "Double click (or middle click) to change color; " tip = _( "Double click (or middle click) to change color; "
"right click for more actions" ); "right click for more actions" );
}
m_netsGrid->GetGridWindow()->SetToolTip( tip ); m_netsGrid->GetGridWindow()->SetToolTip( tip );
} }
@ -994,58 +991,49 @@ bool APPEARANCE_CONTROLS::doesBoardItemNeedRebuild( std::vector<BOARD_ITEM*>& aB
return a->Type() == PCB_NETINFO_T; return a->Type() == PCB_NETINFO_T;
} ); } );
return rebuild; return rebuild;
} }
void APPEARANCE_CONTROLS::OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) void APPEARANCE_CONTROLS::OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aItem )
{ {
if( doesBoardItemNeedRebuild( aBoardItem ) ) if( doesBoardItemNeedRebuild( aItem ) )
handleBoardItemsChanged(); handleBoardItemsChanged();
} }
void APPEARANCE_CONTROLS::OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) void APPEARANCE_CONTROLS::OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aItems )
{ {
if( doesBoardItemNeedRebuild( aBoardItems ) ) if( doesBoardItemNeedRebuild( aItems ) )
{
handleBoardItemsChanged();
}
}
void APPEARANCE_CONTROLS::OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem )
{
if( doesBoardItemNeedRebuild( aBoardItem ) )
handleBoardItemsChanged(); handleBoardItemsChanged();
} }
void APPEARANCE_CONTROLS::OnBoardItemsRemoved( void APPEARANCE_CONTROLS::OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aItem )
BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems )
{ {
if( doesBoardItemNeedRebuild( aBoardItems ) ) if( doesBoardItemNeedRebuild( aItem ) )
{
handleBoardItemsChanged();
}
}
void APPEARANCE_CONTROLS::OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem )
{
if( doesBoardItemNeedRebuild( aBoardItem ) )
handleBoardItemsChanged(); handleBoardItemsChanged();
} }
void APPEARANCE_CONTROLS::OnBoardItemsChanged( void APPEARANCE_CONTROLS::OnBoardItemsRemoved( BOARD& aBoard, std::vector<BOARD_ITEM*>& aItems )
BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems )
{ {
if( doesBoardItemNeedRebuild( aBoardItems ) ) if( doesBoardItemNeedRebuild( aItems ) )
{ handleBoardItemsChanged();
}
void APPEARANCE_CONTROLS::OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aItem )
{
if( doesBoardItemNeedRebuild( aItem ) )
handleBoardItemsChanged();
}
void APPEARANCE_CONTROLS::OnBoardItemsChanged( BOARD& aBoard, std::vector<BOARD_ITEM*>& aItems )
{
if( doesBoardItemNeedRebuild( aItems ) )
handleBoardItemsChanged(); handleBoardItemsChanged();
}
} }
@ -1373,10 +1361,9 @@ void APPEARANCE_CONTROLS::rebuildLayers()
LSET enabled = board->GetEnabledLayers(); LSET enabled = board->GetEnabledLayers();
LSET visible = getVisibleLayers(); LSET visible = getVisibleLayers();
COLOR_SETTINGS* theme = m_frame->GetColorSettings(); COLOR_SETTINGS* theme = m_frame->GetColorSettings();
COLOR4D bgColor = theme->GetColor( LAYER_PCB_BACKGROUND ); COLOR4D bgColor = theme->GetColor( LAYER_PCB_BACKGROUND );
bool firstLayer = true; bool readOnly = theme->IsReadOnly();
bool readOnly = theme->IsReadOnly();
#ifdef __WXMAC__ #ifdef __WXMAC__
wxSizerItem* m_windowLayersSizerItem = m_panelLayersSizer->GetItem( m_windowLayers ); wxSizerItem* m_windowLayersSizerItem = m_panelLayersSizer->GetItem( m_windowLayers );
@ -1421,17 +1408,14 @@ void APPEARANCE_CONTROLS::rebuildLayers()
label->Wrap( -1 ); label->Wrap( -1 );
label->SetToolTip( aSetting->tooltip ); label->SetToolTip( aSetting->tooltip );
int topMargin = firstLayer ? 2 : 1;
firstLayer = false;
sizer->AddSpacer( 1 ); sizer->AddSpacer( 1 );
sizer->Add( indicator, 0, wxALIGN_CENTER_VERTICAL | wxTOP, topMargin ); sizer->Add( indicator, 0, wxALIGN_CENTER_VERTICAL | wxTOP, 2 );
sizer->AddSpacer( 5 ); sizer->AddSpacer( 5 );
sizer->Add( swatch, 0, wxALIGN_CENTER_VERTICAL | wxTOP, topMargin ); sizer->Add( swatch, 0, wxALIGN_CENTER_VERTICAL | wxTOP, 2 );
sizer->AddSpacer( 6 ); sizer->AddSpacer( 6 );
sizer->Add( btn_visible, 0, wxALIGN_CENTER_VERTICAL | wxTOP, topMargin ); sizer->Add( btn_visible, 0, wxALIGN_CENTER_VERTICAL | wxTOP, 2 );
sizer->AddSpacer( 5 ); sizer->AddSpacer( 5 );
sizer->Add( label, 1, wxALIGN_CENTER_VERTICAL | wxTOP, topMargin ); sizer->Add( label, 1, wxALIGN_CENTER_VERTICAL | wxTOP, 2 );
m_layersOuterSizer->Add( panel, 0, wxEXPAND, 0 ); m_layersOuterSizer->Add( panel, 0, wxEXPAND, 0 );
@ -2168,7 +2152,7 @@ void APPEARANCE_CONTROLS::rebuildNets()
sizer->Add( setting->ctl_text, 1, flags, 5 ); sizer->Add( setting->ctl_text, 1, flags, 5 );
m_netclassOuterSizer->Add( setting->ctl_panel, 0, wxEXPAND, 5 ); m_netclassOuterSizer->Add( setting->ctl_panel, 0, wxEXPAND, 5 );
m_netclassOuterSizer->AddSpacer( 1 ); m_netclassOuterSizer->AddSpacer( 2 );
setting->ctl_visibility->Bind( TOGGLE_CHANGED, setting->ctl_visibility->Bind( TOGGLE_CHANGED,
&APPEARANCE_CONTROLS::onNetclassVisibilityChanged, &APPEARANCE_CONTROLS::onNetclassVisibilityChanged,
@ -2351,8 +2335,10 @@ void APPEARANCE_CONTROLS::onLayerPresetChanged( wxCommandEvent& aEvent )
bool exists = m_layerPresets.count( name ); bool exists = m_layerPresets.count( name );
if( !exists ) if( !exists )
{
m_layerPresets[name] = LAYER_PRESET( name, getVisibleLayers(), m_layerPresets[name] = LAYER_PRESET( name, getVisibleLayers(),
getVisibleObjects(), UNSELECTED_LAYER ); getVisibleObjects(), UNSELECTED_LAYER );
}
LAYER_PRESET* preset = &m_layerPresets[name]; LAYER_PRESET* preset = &m_layerPresets[name];
m_currentPreset = preset; m_currentPreset = preset;

View File

@ -206,17 +206,17 @@ public:
void OnBoardNetSettingsChanged( BOARD& aBoard ) override; void OnBoardNetSettingsChanged( BOARD& aBoard ) override;
void OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override; void OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aItem ) override;
void OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) override; void OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aItems ) override;
void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override; void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aItem ) override;
void OnBoardItemsRemoved( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) override; void OnBoardItemsRemoved( BOARD& aBoard, std::vector<BOARD_ITEM*>& aItems ) override;
void OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override; void OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aItem ) override;
void OnBoardItemsChanged( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) override; void OnBoardItemsChanged( BOARD& aBoard, std::vector<BOARD_ITEM*>& aItems ) override;
///< Update the colors on all the widgets from the new chosen color theme. ///< Update the colors on all the widgets from the new chosen color theme.
void OnColorThemeChanged(); void OnColorThemeChanged();

View File

@ -29,11 +29,7 @@ PANEL_SELECTION_FILTER::PANEL_SELECTION_FILTER( wxWindow* aParent ) :
m_frame( dynamic_cast<PCB_BASE_EDIT_FRAME*>( aParent ) ), m_frame( dynamic_cast<PCB_BASE_EDIT_FRAME*>( aParent ) ),
m_onlyCheckbox( nullptr ) m_onlyCheckbox( nullptr )
{ {
#ifdef __WXMAC__
wxFont font = KIUI::GetStatusFont( this );
#else
wxFont font = KIUI::GetInfoFont( this ); wxFont font = KIUI::GetInfoFont( this );
#endif
m_cbLockedItems->SetFont( font ); m_cbLockedItems->SetFont( font );
m_cbFootprints->SetFont( font ); m_cbFootprints->SetFont( font );
m_cbText->SetFont( font ); m_cbText->SetFont( font );