NEW:disabled materials item will retain original color
jira:[STUDIO-10539] Change-Id: Iabdbc6582dae5bcb2ec31775163949f0d451dcca
This commit is contained in:
parent
7115c1ca17
commit
fdb57550aa
|
@ -99,16 +99,18 @@ void MaterialItem::reset_ams_info() {
|
||||||
void MaterialItem::disable()
|
void MaterialItem::disable()
|
||||||
{
|
{
|
||||||
if (IsEnabled()) {
|
if (IsEnabled()) {
|
||||||
this->Disable();
|
//this->Disable();
|
||||||
Refresh();
|
//Refresh();
|
||||||
|
m_enable = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaterialItem::enable()
|
void MaterialItem::enable()
|
||||||
{
|
{
|
||||||
if (!IsEnabled()) {
|
if (!IsEnabled()) {
|
||||||
this->Enable();
|
/*this->Enable();
|
||||||
Refresh();
|
Refresh();*/
|
||||||
|
m_enable = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,6 +104,7 @@ public:
|
||||||
bool m_selected {false};
|
bool m_selected {false};
|
||||||
bool m_warning{false};
|
bool m_warning{false};
|
||||||
bool m_match {true};
|
bool m_match {true};
|
||||||
|
bool m_enable {true};
|
||||||
|
|
||||||
void msw_rescale();
|
void msw_rescale();
|
||||||
void allow_paint_dropdown(bool flag);
|
void allow_paint_dropdown(bool flag);
|
||||||
|
@ -116,7 +117,6 @@ public:
|
||||||
void on_selected();
|
void on_selected();
|
||||||
void on_warning();
|
void on_warning();
|
||||||
|
|
||||||
void on_left_down(wxMouseEvent &evt);
|
|
||||||
void paintEvent(wxPaintEvent &evt);
|
void paintEvent(wxPaintEvent &evt);
|
||||||
virtual void render(wxDC &dc);
|
virtual void render(wxDC &dc);
|
||||||
void match(bool mat);
|
void match(bool mat);
|
||||||
|
|
|
@ -3854,6 +3854,7 @@ void SelectMachineDialog::reset_and_sync_ams_list()
|
||||||
item->SetToolTip(m_ams_tooltip);
|
item->SetToolTip(m_ams_tooltip);
|
||||||
item->Bind(wxEVT_LEFT_UP, [this, item, materials, extruder](wxMouseEvent &e) {});
|
item->Bind(wxEVT_LEFT_UP, [this, item, materials, extruder](wxMouseEvent &e) {});
|
||||||
item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, extruder](wxMouseEvent &e) {
|
item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, extruder](wxMouseEvent &e) {
|
||||||
|
if (!item->m_enable) {return;}
|
||||||
MaterialHash::iterator iter = m_materialList.begin();
|
MaterialHash::iterator iter = m_materialList.begin();
|
||||||
while (iter != m_materialList.end()) {
|
while (iter != m_materialList.end()) {
|
||||||
int id = iter->first;
|
int id = iter->first;
|
||||||
|
@ -4359,6 +4360,8 @@ void SelectMachineDialog::set_default_from_sdcard()
|
||||||
|
|
||||||
item->Bind(wxEVT_LEFT_UP, [this, item, materials](wxMouseEvent& e) {});
|
item->Bind(wxEVT_LEFT_UP, [this, item, materials](wxMouseEvent& e) {});
|
||||||
item->Bind(wxEVT_LEFT_DOWN, [this, obj_, item, materials, diameters_count, fo](wxMouseEvent& e) {
|
item->Bind(wxEVT_LEFT_DOWN, [this, obj_, item, materials, diameters_count, fo](wxMouseEvent& e) {
|
||||||
|
if (!item->m_enable) {return;}
|
||||||
|
|
||||||
MaterialHash::iterator iter = m_materialList.begin();
|
MaterialHash::iterator iter = m_materialList.begin();
|
||||||
while (iter != m_materialList.end()) {
|
while (iter != m_materialList.end()) {
|
||||||
int id = iter->first;
|
int id = iter->first;
|
||||||
|
|
Loading…
Reference in New Issue