Only adjust LAYER_WIDGET font size if larger than indicator.
Also moves adjustment into LAYER_WIDGET so all the callers don't have to deal with it individually. Fixes: lp:1767965 * https://bugs.launchpad.net/kicad/+bug/1767965
This commit is contained in:
parent
2f157f9b23
commit
106dd60e45
|
@ -118,14 +118,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ):
|
||||||
SetScreen( new GBR_SCREEN( GetPageSettings().GetSizeIU() ) );
|
SetScreen( new GBR_SCREEN( GetPageSettings().GetSizeIU() ) );
|
||||||
|
|
||||||
// Create the PCB_LAYER_WIDGET *after* SetLayout():
|
// Create the PCB_LAYER_WIDGET *after* SetLayout():
|
||||||
wxFont font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
|
m_LayersManager = new GERBER_LAYER_WIDGET( this, m_canvas );
|
||||||
int pointSize = font.GetPointSize();
|
|
||||||
int screenHeight = wxSystemSettings::GetMetric( wxSYS_SCREEN_Y );
|
|
||||||
|
|
||||||
if( screenHeight <= 900 )
|
|
||||||
pointSize = (pointSize * 8) / 10;
|
|
||||||
|
|
||||||
m_LayersManager = new GERBER_LAYER_WIDGET( this, m_canvas, pointSize );
|
|
||||||
|
|
||||||
// LoadSettings() *after* creating m_LayersManager, because LoadSettings()
|
// LoadSettings() *after* creating m_LayersManager, because LoadSettings()
|
||||||
// initialize parameters in m_LayersManager
|
// initialize parameters in m_LayersManager
|
||||||
|
|
|
@ -55,9 +55,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
GERBER_LAYER_WIDGET::GERBER_LAYER_WIDGET( GERBVIEW_FRAME* aParent, wxWindow* aFocusOwner,
|
GERBER_LAYER_WIDGET::GERBER_LAYER_WIDGET( GERBVIEW_FRAME* aParent, wxWindow* aFocusOwner ) :
|
||||||
int aPointSize ) :
|
LAYER_WIDGET( aParent, aFocusOwner ),
|
||||||
LAYER_WIDGET( aParent, aFocusOwner, aPointSize ),
|
|
||||||
myframe( aParent )
|
myframe( aParent )
|
||||||
{
|
{
|
||||||
m_alwaysShowActiveLayer = false;
|
m_alwaysShowActiveLayer = false;
|
||||||
|
|
|
@ -75,11 +75,8 @@ public:
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param aParent : the parent frame
|
* @param aParent : the parent frame
|
||||||
* @param aFocusOwner : the window that has the keyboard focus.
|
* @param aFocusOwner : the window that has the keyboard focus.
|
||||||
* @param aPointSize is the font point size to use within the widget. This
|
|
||||||
* effectively sets the overal size of the widget via the row height and bitmap
|
|
||||||
* button sizes.
|
|
||||||
*/
|
*/
|
||||||
GERBER_LAYER_WIDGET( GERBVIEW_FRAME* aParent, wxWindow* aFocusOwner, int aPointSize = 10 );
|
GERBER_LAYER_WIDGET( GERBVIEW_FRAME* aParent, wxWindow* aFocusOwner );
|
||||||
|
|
||||||
void ReFill();
|
void ReFill();
|
||||||
|
|
||||||
|
|
|
@ -267,8 +267,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
// no net in footprint editor: make it non visible
|
// no net in footprint editor: make it non visible
|
||||||
GetBoard()->SetElementVisibility( LAYER_NO_CONNECTS, false );
|
GetBoard()->SetElementVisibility( LAYER_NO_CONNECTS, false );
|
||||||
|
|
||||||
wxFont font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
|
m_Layers = new PCB_LAYER_WIDGET( this, GetCanvas(), true );
|
||||||
m_Layers = new PCB_LAYER_WIDGET( this, GetCanvas(), font.GetPointSize(), true );
|
|
||||||
|
|
||||||
// We should probably allow editing of these in the Footprint Editor's preferences, but
|
// We should probably allow editing of these in the Footprint Editor's preferences, but
|
||||||
// that's not the case at present so copy them from Pcbnew.
|
// that's not the case at present so copy them from Pcbnew.
|
||||||
|
|
|
@ -447,34 +447,33 @@ void LAYER_WIDGET::passOnFocus()
|
||||||
|
|
||||||
//-----<public>-------------------------------------------------------
|
//-----<public>-------------------------------------------------------
|
||||||
|
|
||||||
LAYER_WIDGET::LAYER_WIDGET( wxWindow* aParent, wxWindow* aFocusOwner, int aPointSize,
|
LAYER_WIDGET::LAYER_WIDGET( wxWindow* aParent, wxWindow* aFocusOwner, wxWindowID id,
|
||||||
wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) :
|
const wxPoint& pos, const wxSize& size, long style ) :
|
||||||
wxPanel( aParent, id, pos, size, style )
|
wxPanel( aParent, id, pos, size, style )
|
||||||
{
|
{
|
||||||
|
int indicatorSize = ConvertDialogToPixels( wxSize( 6, 6 ) ).x;
|
||||||
|
m_IconProvider = new ROW_ICON_PROVIDER( indicatorSize );
|
||||||
|
|
||||||
|
int pointSize = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ).GetPointSize();
|
||||||
|
int screenHeight = wxSystemSettings::GetMetric( wxSYS_SCREEN_Y );
|
||||||
|
|
||||||
|
if( screenHeight <= 900 && pointSize >= indicatorSize )
|
||||||
|
pointSize = pointSize * 8 / 10;
|
||||||
|
|
||||||
|
m_PointSize = pointSize;
|
||||||
|
|
||||||
wxBoxSizer* boxSizer = new wxBoxSizer( wxVERTICAL );
|
wxBoxSizer* boxSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
m_notebook = new wxAuiNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_TOP );
|
m_notebook = new wxAuiNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_TOP );
|
||||||
|
|
||||||
wxFont font = m_notebook->GetFont();
|
wxFont font = m_notebook->GetFont();
|
||||||
|
|
||||||
if( aPointSize == -1 )
|
// change the font size on the notebook's tabs to match aPointSize
|
||||||
{
|
font.SetPointSize( pointSize );
|
||||||
m_PointSize = font.GetPointSize();
|
m_notebook->SetFont( font );
|
||||||
}
|
m_notebook->SetNormalFont( font );
|
||||||
else
|
m_notebook->SetSelectedFont( font );
|
||||||
{
|
m_notebook->SetMeasuringFont( font );
|
||||||
m_PointSize = aPointSize;
|
|
||||||
|
|
||||||
// change the font size on the notebook's tabs to match aPointSize
|
|
||||||
font.SetPointSize( aPointSize );
|
|
||||||
m_notebook->SetFont( font );
|
|
||||||
m_notebook->SetNormalFont( font );
|
|
||||||
m_notebook->SetSelectedFont( font );
|
|
||||||
m_notebook->SetMeasuringFont( font );
|
|
||||||
}
|
|
||||||
|
|
||||||
int indicatorSize = ConvertDialogToPixels( wxSize( 6, 6 ) ).x;
|
|
||||||
m_IconProvider = new ROW_ICON_PROVIDER( indicatorSize );
|
|
||||||
|
|
||||||
m_LayerPanel = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
m_LayerPanel = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||||
|
|
||||||
|
|
|
@ -259,18 +259,15 @@ public:
|
||||||
/** Constructor
|
/** Constructor
|
||||||
* @param aParent is the parent window
|
* @param aParent is the parent window
|
||||||
* @param aFocusOwner is the window that should be sent the focus after
|
* @param aFocusOwner is the window that should be sent the focus after
|
||||||
* @param aPointSize is the font point size to use within the widget. This
|
|
||||||
* effectively sets the overal size of the widget via the row height and bitmap
|
|
||||||
* button sizes.
|
|
||||||
* @param id is the wxWindow id ( default = wxID_ANY)
|
* @param id is the wxWindow id ( default = wxID_ANY)
|
||||||
* @param pos is the window position
|
* @param pos is the window position
|
||||||
* @param size is the window size
|
* @param size is the window size
|
||||||
* @param style is the window style
|
* @param style is the window style
|
||||||
* every operation.
|
* every operation.
|
||||||
*/
|
*/
|
||||||
LAYER_WIDGET( wxWindow* aParent, wxWindow* aFocusOwner, int aPointSize = -1,
|
LAYER_WIDGET( wxWindow* aParent, wxWindow* aFocusOwner, wxWindowID id = wxID_ANY,
|
||||||
wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL );
|
long style = wxTAB_TRAVERSAL );
|
||||||
|
|
||||||
virtual ~LAYER_WIDGET();
|
virtual ~LAYER_WIDGET();
|
||||||
|
|
||||||
|
|
|
@ -347,17 +347,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
SetBoard( new BOARD() );
|
SetBoard( new BOARD() );
|
||||||
|
|
||||||
// Create the PCB_LAYER_WIDGET *after* SetBoard():
|
// Create the PCB_LAYER_WIDGET *after* SetBoard():
|
||||||
|
m_Layers = new PCB_LAYER_WIDGET( this, GetCanvas() );
|
||||||
wxFont font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
|
|
||||||
int pointSize = font.GetPointSize();
|
|
||||||
int screenHeight = wxSystemSettings::GetMetric( wxSYS_SCREEN_Y );
|
|
||||||
|
|
||||||
// printf( "pointSize:%d 80%%:%d\n", pointSize, (pointSize*8)/10 );
|
|
||||||
|
|
||||||
if( screenHeight <= 900 )
|
|
||||||
pointSize = (pointSize * 8) / 10;
|
|
||||||
|
|
||||||
m_Layers = new PCB_LAYER_WIDGET( this, GetCanvas(), pointSize );
|
|
||||||
|
|
||||||
m_drc = new DRC( this ); // these 2 objects point to each other
|
m_drc = new DRC( this ); // these 2 objects point to each other
|
||||||
m_plotDialog = nullptr;
|
m_plotDialog = nullptr;
|
||||||
|
|
|
@ -107,8 +107,8 @@ static int s_allowed_in_FpEditor[] =
|
||||||
|
|
||||||
|
|
||||||
PCB_LAYER_WIDGET::PCB_LAYER_WIDGET( PCB_BASE_FRAME* aParent, wxWindow* aFocusOwner,
|
PCB_LAYER_WIDGET::PCB_LAYER_WIDGET( PCB_BASE_FRAME* aParent, wxWindow* aFocusOwner,
|
||||||
int aPointSize, bool aFpEditorMode ) :
|
bool aFpEditorMode ) :
|
||||||
LAYER_WIDGET( aParent, aFocusOwner, aPointSize ),
|
LAYER_WIDGET( aParent, aFocusOwner ),
|
||||||
myframe( aParent )
|
myframe( aParent )
|
||||||
{
|
{
|
||||||
m_alwaysShowActiveCopperLayer = false;
|
m_alwaysShowActiveCopperLayer = false;
|
||||||
|
|
|
@ -47,15 +47,11 @@ public:
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param aParent is the parent window
|
* @param aParent is the parent window
|
||||||
* @param aFocusOwner is the window that should be sent the focus after
|
* @param aFocusOwner is the window that should be sent the focus after
|
||||||
* @param aPointSize is the font point size to use within the widget. This
|
|
||||||
* effectively sets the overall size of the widget via the row height and bitmap
|
|
||||||
* button sizes.
|
|
||||||
* @param aFpEditorMode false for the board editor (default), true for fp editor
|
* @param aFpEditorMode false for the board editor (default), true for fp editor
|
||||||
* when true, some options or layers which cannot be used in editor mode are not
|
* when true, some options or layers which cannot be used in editor mode are not
|
||||||
* displayed
|
* displayed
|
||||||
*/
|
*/
|
||||||
PCB_LAYER_WIDGET( PCB_BASE_FRAME* aParent, wxWindow* aFocusOwner,
|
PCB_LAYER_WIDGET( PCB_BASE_FRAME* aParent, wxWindow* aFocusOwner, bool aFpEditorMode = false );
|
||||||
int aPointSize = 10, bool aFpEditorMode = false );
|
|
||||||
|
|
||||||
void ReFill();
|
void ReFill();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue