From feb4857cf8d83829b844d30b86c6eeb9170454be Mon Sep 17 00:00:00 2001
From: enricoturri1966 <enricoturri@seznam.cz>
Date: Tue, 30 Jun 2020 12:53:42 +0200
Subject: [PATCH] Fixed height of features type combo popup when building
 against wxWidgets 3.1.3

---
 src/slic3r/GUI/wxExtensions.cpp | 12 ++++--------
 src/slic3r/GUI/wxExtensions.hpp |  1 -
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp
index 74d790df8..c42933b9b 100644
--- a/src/slic3r/GUI/wxExtensions.cpp
+++ b/src/slic3r/GUI/wxExtensions.cpp
@@ -174,7 +174,6 @@ wxMenuItem* append_menu_check_item(wxMenu* menu, int id, const wxString& string,
 
 const unsigned int wxCheckListBoxComboPopup::DefaultWidth = 200;
 const unsigned int wxCheckListBoxComboPopup::DefaultHeight = 200;
-const unsigned int wxCheckListBoxComboPopup::DefaultItemHeight = 18;
 
 bool wxCheckListBoxComboPopup::Create(wxWindow* parent)
 {
@@ -202,20 +201,17 @@ wxSize wxCheckListBoxComboPopup::GetAdjustedSize(int minWidth, int prefHeight, i
     // and set height dinamically in dependence of items count
 
     wxComboCtrl* cmb = GetComboCtrl();
-    if (cmb != nullptr)
-    {
+    if (cmb != nullptr) {
         wxSize size = GetComboCtrl()->GetSize();
 
         unsigned int count = GetCount();
-        if (count > 0)
-        {
+        if (count > 0) {
             int max_width = size.x;
-            for (unsigned int i = 0; i < count; ++i)
-            {
+            for (unsigned int i = 0; i < count; ++i) {
                 max_width = std::max(max_width, 60 + GetTextExtent(GetString(i)).x);
             }
             size.SetWidth(max_width);
-            size.SetHeight(4 + count * (2 + GetTextExtent(GetString(0)).y));
+            size.SetHeight(count * cmb->GetCharHeight());
         }
         else
             size.SetHeight(DefaultHeight);
diff --git a/src/slic3r/GUI/wxExtensions.hpp b/src/slic3r/GUI/wxExtensions.hpp
index 569257e1b..254dbfad3 100644
--- a/src/slic3r/GUI/wxExtensions.hpp
+++ b/src/slic3r/GUI/wxExtensions.hpp
@@ -63,7 +63,6 @@ class wxCheckListBoxComboPopup : public wxCheckListBox, public wxComboPopup
 {
     static const unsigned int DefaultWidth;
     static const unsigned int DefaultHeight;
-    static const unsigned int DefaultItemHeight;
 
     wxString m_text;