From 23b1c8f1d264ba0ae59d3c304e450370eab54225 Mon Sep 17 00:00:00 2001 From: Enrico Turri <enricoturri@seznam.cz> Date: Tue, 20 Feb 2018 14:44:00 +0100 Subject: [PATCH] 3rd attempt to fix JIRA SPE-26 (Feature types on MAC) --- xs/src/slic3r/GUI/wxExtensions.cpp | 7 ++----- xs/src/slic3r/GUI/wxExtensions.hpp | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/xs/src/slic3r/GUI/wxExtensions.cpp b/xs/src/slic3r/GUI/wxExtensions.cpp index 1bc329648..f9805cdb1 100644 --- a/xs/src/slic3r/GUI/wxExtensions.cpp +++ b/xs/src/slic3r/GUI/wxExtensions.cpp @@ -2,6 +2,7 @@ const unsigned int wxCheckListBoxComboPopup::DefaultWidth = 200; const unsigned int wxCheckListBoxComboPopup::DefaultHeight = 200; +const unsigned int wxCheckListBoxComboPopup::DefaultItemHeight = 18; bool wxCheckListBoxComboPopup::Create(wxWindow* parent) { @@ -35,11 +36,7 @@ wxSize wxCheckListBoxComboPopup::GetAdjustedSize(int minWidth, int prefHeight, i unsigned int count = GetCount(); if (count > 0) - { - wxRect first_rect; - GetItemRect(0, first_rect); - size.SetHeight((1 + count) * first_rect.GetHeight()); - } + size.SetHeight(count * DefaultItemHeight); else size.SetHeight(DefaultHeight); diff --git a/xs/src/slic3r/GUI/wxExtensions.hpp b/xs/src/slic3r/GUI/wxExtensions.hpp index 3fc4c70a7..e61c17bbc 100644 --- a/xs/src/slic3r/GUI/wxExtensions.hpp +++ b/xs/src/slic3r/GUI/wxExtensions.hpp @@ -8,6 +8,7 @@ class wxCheckListBoxComboPopup : public wxCheckListBox, public wxComboPopup { static const unsigned int DefaultWidth; static const unsigned int DefaultHeight; + static const unsigned int DefaultItemHeight; wxString m_text;