From 2ff95054437cd2e4f3d1ace2f81af1fd601c5c5c Mon Sep 17 00:00:00 2001 From: YuSanka Date: Mon, 25 Feb 2019 10:14:49 +0100 Subject: [PATCH] Fixed wrong updating of the editable ComboBox under OSX --- src/slic3r/GUI/Field.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index d514615f2..0d65e0ef5 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -631,8 +631,13 @@ void Choice::set_value(const boost::any& value, bool change_event) break; ++idx; } - idx == m_opt.enum_values.size() ? - dynamic_cast(window)->SetValue(text_value) : + if (idx == m_opt.enum_values.size()) { + // For editable Combobox under OSX is needed to set selection to -1 explicitly, + // otherwise selection doesn't be changed + dynamic_cast(window)->SetSelection(-1); + dynamic_cast(window)->SetValue(text_value); + } + else dynamic_cast(window)->SetSelection(idx); break; }