mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 15:49:01 +08:00
Fix for SPE-1976 : Crash on extruder change
+ Updated Ui color mode for Extruder combobox
This commit is contained in:
parent
fc5a4c1e13
commit
e1ff5feb41
@ -5,6 +5,7 @@
|
|||||||
#include "ExtraRenderers.hpp"
|
#include "ExtraRenderers.hpp"
|
||||||
#include "wxExtensions.hpp"
|
#include "wxExtensions.hpp"
|
||||||
#include "GUI.hpp"
|
#include "GUI.hpp"
|
||||||
|
#include "GUI_App.hpp"
|
||||||
#include "I18N.hpp"
|
#include "I18N.hpp"
|
||||||
#include "BitmapComboBox.hpp"
|
#include "BitmapComboBox.hpp"
|
||||||
#include "Plater.hpp"
|
#include "Plater.hpp"
|
||||||
@ -330,6 +331,10 @@ wxWindow* BitmapChoiceRenderer::CreateEditorCtrl(wxWindow* parent, wxRect labelR
|
|||||||
labelRect.GetTopLeft(), wxSize(labelRect.GetWidth(), -1),
|
labelRect.GetTopLeft(), wxSize(labelRect.GetWidth(), -1),
|
||||||
0, nullptr , wxCB_READONLY);
|
0, nullptr , wxCB_READONLY);
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
Slic3r::GUI::wxGetApp().UpdateDarkUI(c_editor);
|
||||||
|
#endif
|
||||||
|
|
||||||
int def_id = get_default_extruder_idx ? get_default_extruder_idx() : 0;
|
int def_id = get_default_extruder_idx ? get_default_extruder_idx() : 0;
|
||||||
c_editor->Append(_L("default"), def_id < 0 ? wxNullBitmap : *icons[def_id]);
|
c_editor->Append(_L("default"), def_id < 0 ? wxNullBitmap : *icons[def_id]);
|
||||||
for (size_t i = 0; i < icons.size(); i++)
|
for (size_t i = 0; i < icons.size(); i++)
|
||||||
@ -356,7 +361,11 @@ wxWindow* BitmapChoiceRenderer::CreateEditorCtrl(wxWindow* parent, wxRect labelR
|
|||||||
|
|
||||||
bool BitmapChoiceRenderer::GetValueFromEditorCtrl(wxWindow* ctrl, wxVariant& value)
|
bool BitmapChoiceRenderer::GetValueFromEditorCtrl(wxWindow* ctrl, wxVariant& value)
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
Slic3r::GUI::BitmapComboBox* c = static_cast<Slic3r::GUI::BitmapComboBox*>(ctrl);
|
||||||
|
#else
|
||||||
wxBitmapComboBox* c = static_cast<wxBitmapComboBox*>(ctrl);
|
wxBitmapComboBox* c = static_cast<wxBitmapComboBox*>(ctrl);
|
||||||
|
#endif
|
||||||
int selection = c->GetSelection();
|
int selection = c->GetSelection();
|
||||||
if (selection < 0)
|
if (selection < 0)
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user