ENH: param multiple extruder indicator icon
Change-Id: I9e382dc72deaa0b682b1474c9b4094c31e550ad8 Jira: STUDIO-8872, STUDIO-9213
This commit is contained in:
parent
04d7c3485a
commit
dba496e1cc
|
@ -121,7 +121,7 @@ int OG_CustomCtrl::get_height(const Line& line)
|
|||
for (auto ctrl_line : ctrl_lines)
|
||||
if (&ctrl_line.og_line == &line)
|
||||
return ctrl_line.height;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -366,7 +366,7 @@ void OG_CustomCtrl::OnMotion(wxMouseEvent& event)
|
|||
tooltip += line.og_line.label_tooltip;
|
||||
// BBS: markdown tip
|
||||
focusedLine = &line;
|
||||
markdowntip = line.og_line.label.empty()
|
||||
markdowntip = line.og_line.label.empty()
|
||||
? line.og_line.get_options().front().opt_id : into_u8(line.og_line.label);
|
||||
markdowntip.erase(0, markdowntip.find_last_of('#') + 1);
|
||||
// BBS
|
||||
|
@ -769,9 +769,18 @@ void OG_CustomCtrl::CtrlLine::render(wxDC& dc, wxCoord h_pos, wxCoord v_pos)
|
|||
break;
|
||||
}
|
||||
}
|
||||
bool is_multi_extruder = false;
|
||||
if (ctrl->opt_group->draw_multi_extruder)
|
||||
for (const Option& opt : option_set)
|
||||
is_multi_extruder |= opt.opt_id.find_last_of('#') != std::string::npos;
|
||||
wxCoord icon_pos = h_pos;
|
||||
if (is_multi_extruder) {
|
||||
static ScalableBitmap multi_extruder(ctrl, "multi_extruder");
|
||||
h_pos = draw_act_bmps(dc, wxPoint(h_pos, v_pos), multi_extruder.bmp(), multi_extruder.bmp(), false);
|
||||
}
|
||||
is_url_string = !suppress_hyperlinks && !og_line.label_path.empty();
|
||||
// BBS
|
||||
h_pos = draw_text(dc, wxPoint(h_pos, v_pos), label /* + ":" */, text_clr, ctrl->opt_group->label_width * ctrl->m_em_unit, is_url_string, true);
|
||||
h_pos = draw_text(dc, wxPoint(h_pos, v_pos), label /* + ":" */, text_clr, icon_pos + ctrl->opt_group->label_width * ctrl->m_em_unit - h_pos, is_url_string, true);
|
||||
}
|
||||
|
||||
// If there's a widget, build it and set result to the correct position.
|
||||
|
@ -805,7 +814,7 @@ void OG_CustomCtrl::CtrlLine::render(wxDC& dc, wxCoord h_pos, wxCoord v_pos)
|
|||
h_pos = draw_act_bmps(dc, wxPoint(h_pos, v_pos), field->undo_to_sys_bitmap()->bmp(), field->undo_bitmap()->bmp(), field->blink(), bmp_rect_id);
|
||||
}
|
||||
#ifndef DISABLE_BLINKING
|
||||
else if (field && !field->undo_to_sys_bitmap() && field->blink())
|
||||
else if (field && !field->undo_to_sys_bitmap() && field->blink())
|
||||
draw_blinking_bmp(dc, wxPoint(h_pos, v_pos), field->blink());
|
||||
#endif
|
||||
};
|
||||
|
@ -911,7 +920,7 @@ wxCoord OG_CustomCtrl::CtrlLine::draw_text(wxDC &dc, wxPoint pos, const wxString
|
|||
dc.SetFont(old_font.Underlined());
|
||||
#else
|
||||
dc.SetFont(old_font.Bold().Underlined());
|
||||
#endif
|
||||
#endif
|
||||
color = &clr_url;
|
||||
}
|
||||
dc.SetTextForeground(color ? *color :
|
||||
|
|
|
@ -127,6 +127,7 @@ public:
|
|||
wxFont label_font {wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT) };
|
||||
int sidetext_width{ -1 };
|
||||
int sublabel_width{ -1 };
|
||||
bool draw_multi_extruder { false };
|
||||
|
||||
/// Returns a copy of the pointer of the parent wxWindow.
|
||||
/// Accessor function is because users are not allowed to change the parent
|
||||
|
|
|
@ -3237,8 +3237,6 @@ void TabFilament::build()
|
|||
on_value_change(opt_key, value);
|
||||
};
|
||||
|
||||
optgroup = page->new_optgroup(L("Nozzle temperature"), L"param_temperature");
|
||||
|
||||
line = { L("Nozzle"), L("Nozzle temperature when printing") };
|
||||
line.append_option(optgroup->get_option("nozzle_temperature_initial_layer", 0));
|
||||
line.append_option(optgroup->get_option("nozzle_temperature", 0));
|
||||
|
@ -3987,6 +3985,7 @@ void TabPrinter::build_unregular_pages(bool from_initial_build/* = false*/)
|
|||
existed_page = i;
|
||||
break;
|
||||
}
|
||||
m_rebuild_kinematics_page = false;
|
||||
|
||||
if (existed_page < n_before_extruders && (is_marlin_flavor || from_initial_build)) {
|
||||
auto page = build_kinematics_page();
|
||||
|
@ -6016,8 +6015,9 @@ void Tab::switch_excluder(int extruder_id, bool reload)
|
|||
auto index = m_variant_combo ? extruder_id : get_index_for_extruder(extruder_id == -1 ? 0 : extruder_id);
|
||||
if (index < 0)
|
||||
return;
|
||||
if (m_extruder_switch) m_extruder_switch->SetClientData((void *) (index));
|
||||
if (m_variant_combo) m_variant_combo->SetClientData((void *) (index));
|
||||
if (m_extruder_switch) m_extruder_switch->SetClientData(reinterpret_cast<void*>(static_cast<std::uintptr_t>(index)));
|
||||
if (m_variant_combo) m_variant_combo->SetClientData(reinterpret_cast<void *>(static_cast<std::uintptr_t>(index)));
|
||||
wxWindow *variant_ctrl = m_extruder_switch ? (wxWindow *) m_extruder_switch : m_variant_combo;
|
||||
for (auto page : m_pages) {
|
||||
bool is_extruder = false;
|
||||
if (m_type == Preset::TYPE_PRINTER) {
|
||||
|
@ -6039,10 +6039,12 @@ void Tab::switch_excluder(int extruder_id, bool reload)
|
|||
page->m_opt_id_map.insert({opt.first, opt.first});
|
||||
continue;
|
||||
}
|
||||
group->draw_multi_extruder = false;
|
||||
for (auto &opt : group->opt_map()) {
|
||||
if (opt.second.second >= 0) {
|
||||
const_cast<int &>(opt.second.second) = index;
|
||||
page->m_opt_id_map.insert({opt.second.first + "#" + std::to_string(index), opt.first});
|
||||
group->draw_multi_extruder = !is_extruder && variant_ctrl->IsThisEnabled();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue