Add additional buffer space around cell text buttons

The baseline -1 buffer works for some GTK themes but not others.  -3
appears to work for chunky themes like those used in KDE (and others).

Fixes https://gitlab.com/kicad/code/kicad/issues/5690
This commit is contained in:
Seth Hillbrand 2022-01-26 12:42:28 -08:00
parent 810a49ef1b
commit b87e4efc68
1 changed files with 6 additions and 1 deletions

View File

@ -59,7 +59,12 @@ wxString GRID_CELL_TEXT_BUTTON::GetValue() const
void GRID_CELL_TEXT_BUTTON::SetSize( const wxRect& aRect ) void GRID_CELL_TEXT_BUTTON::SetSize( const wxRect& aRect )
{ {
wxRect rect( aRect ); wxRect rect( aRect );
rect.Inflate( -1 ); rect.Inflate( -3 ); // The -3 is a very sad hack here. Some GTK themes
// Overrun the default -1, preventing display
// Unfortunately, we don't appear to have a good method
// of finding the current margin needed. Some GTK
// resize events seem to update the cell size but not
// all and not consistently
#if defined( __WXMAC__ ) #if defined( __WXMAC__ )
rect.Inflate( 3 ); // no FOCUS_RING, even on Mac rect.Inflate( 3 ); // no FOCUS_RING, even on Mac