From b87e4efc68ea93e24b4e1189e7a83502cc475d7b Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 26 Jan 2022 12:42:28 -0800 Subject: [PATCH] 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 --- common/widgets/grid_text_button_helpers.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/widgets/grid_text_button_helpers.cpp b/common/widgets/grid_text_button_helpers.cpp index f298c49219..2c28f71b50 100644 --- a/common/widgets/grid_text_button_helpers.cpp +++ b/common/widgets/grid_text_button_helpers.cpp @@ -59,7 +59,12 @@ wxString GRID_CELL_TEXT_BUTTON::GetValue() const void GRID_CELL_TEXT_BUTTON::SetSize( const wxRect& 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__ ) rect.Inflate( 3 ); // no FOCUS_RING, even on Mac