mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-13 03:01:48 +08:00
Fix for #6692 - Slice button not appearing after infill change
This commit is contained in:
parent
c0a00f4e70
commit
ed25d5c53d
@ -935,7 +935,7 @@ void Choice::BUILD() {
|
|||||||
choice_ctrl* temp;
|
choice_ctrl* temp;
|
||||||
if (m_opt.gui_type != ConfigOptionDef::GUIType::undefined && m_opt.gui_type != ConfigOptionDef::GUIType::select_open) {
|
if (m_opt.gui_type != ConfigOptionDef::GUIType::undefined && m_opt.gui_type != ConfigOptionDef::GUIType::select_open) {
|
||||||
m_is_editable = true;
|
m_is_editable = true;
|
||||||
temp = new choice_ctrl(m_parent, wxID_ANY, wxString(""), wxDefaultPosition, size);
|
temp = new choice_ctrl(m_parent, wxID_ANY, wxString(""), wxDefaultPosition, size, 0, nullptr, wxTE_PROCESS_ENTER);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef __WXOSX__
|
#ifdef __WXOSX__
|
||||||
@ -988,8 +988,36 @@ void Choice::BUILD() {
|
|||||||
temp->Bind(wxEVT_COMBOBOX, [this](wxCommandEvent&) { on_change_field(); }, temp->GetId());
|
temp->Bind(wxEVT_COMBOBOX, [this](wxCommandEvent&) { on_change_field(); }, temp->GetId());
|
||||||
|
|
||||||
if (m_is_editable) {
|
if (m_is_editable) {
|
||||||
temp->Bind(wxEVT_KILL_FOCUS, ([this](wxEvent& e) {
|
temp->Bind(wxEVT_KILL_FOCUS, [this](wxEvent& e) {
|
||||||
e.Skip();
|
e.Skip();
|
||||||
|
if (bKilledFocus)
|
||||||
|
return;
|
||||||
|
|
||||||
|
bKilledFocus = true;
|
||||||
|
|
||||||
|
if (bEnterPressed)
|
||||||
|
bEnterPressed = false;
|
||||||
|
else
|
||||||
|
propagate_value();
|
||||||
|
// After processing of KILL_FOCUS event we should to invalidate a bKilledFocus flag
|
||||||
|
bKilledFocus = false;
|
||||||
|
} );
|
||||||
|
|
||||||
|
temp->Bind(wxEVT_TEXT_ENTER, [this, temp](wxEvent& e) {
|
||||||
|
#ifdef _WIN32
|
||||||
|
temp->SetFocus();
|
||||||
|
#else
|
||||||
|
bEnterPressed = true;
|
||||||
|
propagate_value();
|
||||||
|
#endif //_WIN32
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
temp->SetToolTip(get_tooltip_text(temp->GetValue()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Choice::propagate_value()
|
||||||
|
{
|
||||||
if (m_opt.type == coStrings) {
|
if (m_opt.type == coStrings) {
|
||||||
on_change_field();
|
on_change_field();
|
||||||
return;
|
return;
|
||||||
@ -1022,10 +1050,6 @@ void Choice::BUILD() {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
on_kill_focus();
|
on_kill_focus();
|
||||||
}), temp->GetId());
|
|
||||||
}
|
|
||||||
|
|
||||||
temp->SetToolTip(get_tooltip_text(temp->GetValue()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Choice::suppress_scroll()
|
void Choice::suppress_scroll()
|
||||||
|
@ -342,6 +342,8 @@ public:
|
|||||||
|
|
||||||
class Choice : public Field {
|
class Choice : public Field {
|
||||||
using Field::Field;
|
using Field::Field;
|
||||||
|
bool bKilledFocus = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Choice(const ConfigOptionDef& opt, const t_config_option_key& id) : Field(opt, id) {}
|
Choice(const ConfigOptionDef& opt, const t_config_option_key& id) : Field(opt, id) {}
|
||||||
Choice(wxWindow* parent, const ConfigOptionDef& opt, const t_config_option_key& id) : Field(parent, opt, id) {}
|
Choice(wxWindow* parent, const ConfigOptionDef& opt, const t_config_option_key& id) : Field(parent, opt, id) {}
|
||||||
@ -349,6 +351,8 @@ public:
|
|||||||
|
|
||||||
wxWindow* window{ nullptr };
|
wxWindow* window{ nullptr };
|
||||||
void BUILD() override;
|
void BUILD() override;
|
||||||
|
// Propagate value from field to the OptionGroupe and Config after kill_focus/ENTER
|
||||||
|
void propagate_value();
|
||||||
|
|
||||||
/* Under OSX: wxBitmapComboBox->GetWindowStyle() returns some weard value,
|
/* Under OSX: wxBitmapComboBox->GetWindowStyle() returns some weard value,
|
||||||
* so let use a flag, which has TRUE value for a control without wxCB_READONLY style
|
* so let use a flag, which has TRUE value for a control without wxCB_READONLY style
|
||||||
|
Loading…
x
Reference in New Issue
Block a user