From bbd4cfd3d452caad548290bb7e0e038d69ffbb7f Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Tue, 27 Feb 2024 19:24:53 -0500 Subject: [PATCH] Force lib tree row height on GTK Fixes https://gitlab.com/kicad/code/kicad/-/issues/16403 (cherry picked from commit c3af434741b9e7ca1bca440b466f1a8328d8283e) --- common/widgets/lib_tree.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/widgets/lib_tree.cpp b/common/widgets/lib_tree.cpp index c141d6f948..8ff4697b29 100644 --- a/common/widgets/lib_tree.cpp +++ b/common/widgets/lib_tree.cpp @@ -156,6 +156,12 @@ LIB_TREE::LIB_TREE( wxWindow* aParent, const wxString& aRecentSearchesKey, LIB_T m_tree_ctrl = new WX_DATAVIEWCTRL( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, dvFlags ); m_adapter->AttachTo( m_tree_ctrl ); +#ifdef __WXGTK__ + // The GTK renderer seems to calculate row height incorrectly sometimes; but can be overridden + int rowHeight = FromDIP( 8 ) + GetTextExtent( wxS( "pdI" ) ).y; + m_tree_ctrl->SetRowHeight( rowHeight ); +#endif + sizer->Add( m_tree_ctrl, 5, wxRIGHT | wxBOTTOM | wxEXPAND, 5 ); // Description panel