UNIT_BINDER: allows more room to show values (especially inches need room)
Fixes #15539 https://gitlab.com/kicad/code/kicad/-/issues/15539
This commit is contained in:
parent
f9b59b4fdf
commit
07e13c51d1
|
@ -66,8 +66,11 @@ UNIT_BINDER::UNIT_BINDER( UNITS_PROVIDER* aUnitsProvider, wxWindow* aEventSource
|
||||||
if( textEntry )
|
if( textEntry )
|
||||||
{
|
{
|
||||||
wxClientDC dc( m_valueCtrl );
|
wxClientDC dc( m_valueCtrl );
|
||||||
|
|
||||||
|
// Gives enough room to display a value in inches i )n textEntry
|
||||||
|
// 4 digits + '.' + 10 digits + 2 chars (units) look enough.
|
||||||
wxSize minSize = m_valueCtrl->GetMinSize();
|
wxSize minSize = m_valueCtrl->GetMinSize();
|
||||||
int minWidth = dc.GetTextExtent( wxT( "XXX.XXXXXXX" ) ).GetWidth();
|
int minWidth = dc.GetTextExtent( wxT( "XXXX.XXXXXXXXXXUU" ) ).GetWidth();
|
||||||
|
|
||||||
if( minSize.GetWidth() < minWidth )
|
if( minSize.GetWidth() < minWidth )
|
||||||
m_valueCtrl->SetMinSize( wxSize( minWidth, minSize.GetHeight() ) );
|
m_valueCtrl->SetMinSize( wxSize( minWidth, minSize.GetHeight() ) );
|
||||||
|
|
Loading…
Reference in New Issue