Merge branch 'main' into feat/configurable-bambu-network-lib

This commit is contained in:
SoftFever 2025-12-19 22:18:19 +08:00 committed by GitHub
commit 11c9794faa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
127 changed files with 921 additions and 1657 deletions

View file

@ -112,6 +112,11 @@ void AppConfig::set_defaults()
if (get("background_processing").empty())
set_bool("background_processing", false);
#endif
if (get("auto_slice_after_change").empty())
set_bool("auto_slice_after_change", false);
if (get("auto_slice_change_delay_seconds").empty())
set("auto_slice_change_delay_seconds", "1");
if (get("drop_project_action").empty())
set_bool("drop_project_action", true);

View file

@ -4251,8 +4251,8 @@ LayerResult GCode::process_layer(
bool is_multi_extruder = m_config.nozzle_diameter.size() > 1;
bool need_insert_timelapse_gcode_for_traditional = false;
if (!m_wipe_tower || !m_wipe_tower->enable_timelapse_print()) {
need_insert_timelapse_gcode_for_traditional = ((is_i3_printer && !m_spiral_vase)|| is_multi_extruder);
if ((!m_wipe_tower || !m_wipe_tower->enable_timelapse_print()) && (is_BBL_Printer() || !m_config.time_lapse_gcode.value.empty())) {
need_insert_timelapse_gcode_for_traditional = ((is_i3_printer && !m_spiral_vase) || is_multi_extruder);
}
bool has_insert_timelapse_gcode = false;
@ -4268,19 +4268,18 @@ LayerResult GCode::process_layer(
gcode += this->change_layer(print_z); // this will increase m_layer_index
m_layer = &layer;
m_object_layer_over_raft = false;
if(is_BBL_Printer()){
} else {
if (!m_config.time_lapse_gcode.value.empty()) {
DynamicConfig config;
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
config.set_key_value("layer_z", new ConfigOptionFloat(print_z));
config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z));
gcode += this->placeholder_parser_process("timelapse_gcode", print.config().time_lapse_gcode.value, m_writer.filament()->id(),
&config) +
"\n";
}
if (!m_config.time_lapse_gcode.value.empty() && !is_BBL_Printer()) {
DynamicConfig config;
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
config.set_key_value("layer_z", new ConfigOptionFloat(print_z));
config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z));
gcode += this->placeholder_parser_process("timelapse_gcode",
print.config().time_lapse_gcode.value, m_writer.filament()->id(), &config)
+ "\n";
}
if (! m_config.layer_change_gcode.value.empty()) {
if (!m_config.layer_change_gcode.value.empty()) {
DynamicConfig config;
config.set_key_value("most_used_physical_extruder_id", new ConfigOptionInt(m_config.physical_extruder_map.get_at(most_used_extruder)));
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
@ -4729,7 +4728,7 @@ LayerResult GCode::process_layer(
auto timelapse_pos=m_timelapse_pos_picker.pick_pos(ctx);
std::string timepals_gcode;
std::string timelapse_gcode;
if (!print.config().time_lapse_gcode.value.empty()) {
DynamicConfig config;
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
@ -4740,17 +4739,18 @@ LayerResult GCode::process_layer(
config.set_key_value("timelapse_pos_x", new ConfigOptionInt((int)timelapse_pos.x()));
config.set_key_value("timelapse_pos_y", new ConfigOptionInt((int)timelapse_pos.y()));
config.set_key_value("has_timelapse_safe_pos", new ConfigOptionBool(timelapse_pos != DefaultTimelapsePos));
timepals_gcode = this->placeholder_parser_process("timelapse_gcode", print.config().time_lapse_gcode.value, m_writer.filament()->id(), &config) + "\n";
timelapse_gcode = this->placeholder_parser_process("timelapse_gcode", print.config().time_lapse_gcode.value, m_writer.filament()->id(), &config) + "\n";
}
if (!timepals_gcode.empty()) {
m_writer.set_current_position_clear(false);
double temp_z_after_tool_change;
if (GCodeProcessor::get_last_z_from_gcode(timepals_gcode, temp_z_after_tool_change)) {
Vec3d pos = m_writer.get_position();
pos(2) = temp_z_after_tool_change;
m_writer.set_position(pos);
}
if (!timelapse_gcode.empty()) {
m_writer.set_current_position_clear(false);
double temp_z_after_tool_change;
if (GCodeProcessor::get_last_z_from_gcode(timelapse_gcode, temp_z_after_tool_change)) {
Vec3d pos = m_writer.get_position();
pos(2) = temp_z_after_tool_change;
m_writer.set_position(pos);
}
}
// (layer_object_label_ids.size() < 64) this restriction comes from _encode_label_ids_to_base64()
@ -4771,13 +4771,13 @@ LayerResult GCode::process_layer(
std::string end_str = std::string("; object ids of this layer") + std::to_string(m_layer_index + 1) + (" end: ") + oss.str() + "\n";
end_str += "M625\n";
timepals_gcode = start_str + timepals_gcode + end_str;
timelapse_gcode = start_str + timelapse_gcode + end_str;
}
return timepals_gcode;
return timelapse_gcode;
};
if (!need_insert_timelapse_gcode_for_traditional) { // Equivalent to the timelapse gcode placed in layer_change_gcode
if (!need_insert_timelapse_gcode_for_traditional && is_BBL_Printer()) { // Equivalent to the timelapse gcode placed in layer_change_gcode
if (FILAMENT_CONFIG(retract_when_changing_layer)) {
gcode += this->retract(false, false, auto_lift_type, true);
}
@ -4873,10 +4873,12 @@ LayerResult GCode::process_layer(
gcode_toolchange = this->set_extruder(extruder_id, print_z);
}
if (!gcode_toolchange.empty()) {
// Disable vase mode for layers that has toolchange
result.spiral_vase_enable = false;
}
gcode += std::move(gcode_toolchange);
// let analyzer tag generator aware of a role type change

View file

@ -42,6 +42,7 @@ void GCodeWriter::apply_print_config(const PrintConfig &print_config)
};
m_max_jerk_z = print_config.machine_max_jerk_z.values.front();
m_max_jerk_e = print_config.machine_max_jerk_e.values.front();
m_resolution = print_config.resolution.value;
}
void GCodeWriter::set_extruders(std::vector<unsigned int> extruder_ids)
@ -787,8 +788,18 @@ std::string GCodeWriter::_spiral_travel_to_z(double z, const Vec2d &ij_offset, c
if (!this->config.enable_arc_fitting) { // Orca: if arc fitting is disabled, approximate the arc with small linear segments
std::ostringstream oss;
const double z_start = m_pos(2); // starting Z height
const int segments = 24; // number of linear segments to use for approximating the arc
const double z_start = m_pos(2); // starting Z height
// --------------------------------------------------------------------
// Determine number of segments based on Resolution
// --------------------------------------------------------------------
const double ref_resolution = 0.01; // reference resolution in mm
const double ref_segments = 16.0; // reference number of segments at reference resolution
// number of linear segments to use for approximating the arc, clamp between 4 and 24
const int segments = std::clamp(int(std::round(ref_segments * (ref_resolution / m_resolution))), 4, 24);
// --------------------------------------------------------------------
const double px = m_pos(0) - m_x_offset; // take plate offset into consideration
const double py = m_pos(1) - m_y_offset; // take plate offset into consideration
const double cx = px + ij_offset(0); // center x

View file

@ -168,6 +168,9 @@ public:
//BBS: x, y offset for gcode generated
double m_x_offset{ 0 };
double m_y_offset{ 0 };
// Orca: slicing resolution in mm
double m_resolution = 0.01;
std::string m_gcode_label_objects_start;
std::string m_gcode_label_objects_end;

View file

@ -161,11 +161,18 @@ void extend_default_config_length(DynamicPrintConfig& config, const bool set_nil
int process_variant_length = default_param_length;
int machine_variant_length = default_param_length;
// Orca: use nozzle/extruder count as the default printer variant length
// because non-BBL multi-extruder printers currently do not support extruder variant.
if (config.has("nozzle_diameter")) {
auto* nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(config.option("nozzle_diameter"));
machine_variant_length = nozzle_diameter->values.size();
}
if(config.has("filament_extruder_variant"))
filament_variant_length = config.option<ConfigOptionStrings>("filament_extruder_variant")->size();
if(config.has("print_extruder_variant"))
process_variant_length = config.option<ConfigOptionStrings>("print_extruder_variant")->size();
if(config.has("printer_extruder_variant"))
if(config.has("printer_extruder_variant")) // Use existing variant list if specified, so BBL's multi-variant profiles still works
machine_variant_length = config.option<ConfigOptionStrings>("printer_extruder_variant")->size();
auto replace_nil_and_resize = [&](const std::string & key, int length){

View file

@ -7996,8 +7996,41 @@ size_t DynamicPrintConfig::get_parameter_size(const std::string& param_name, siz
return extruder_nums;
}
// Orca: Special handling for extruder variants
// BBL printers have extruder variants pre-defined in system profiles, however for customized multi-extruder profile,
// we need to set up these parameters automatically, otherwise per-extruder options won't work properly.
static void extend_extruder_variant(DynamicPrintConfig& config, const unsigned int num_extruders)
{
// 1. Make sure the `extruder_variant_list` is the same length as extruder cnt
auto extruder_variant_opt = dynamic_cast<ConfigOptionStrings*>(config.option("extruder_variant_list"));
assert(extruder_variant_opt != nullptr);
extruder_variant_opt->resize(num_extruders, extruder_variant_opt); // Use the first option as the default value, so all extruders have the same variant
// 2. Update `printer_extruder_variant` and `printer_extruder_id` based on `extruder_variant_list`
auto printer_extruder_id_opt = dynamic_cast<ConfigOptionInts*>(config.option("printer_extruder_id"));
assert(printer_extruder_id_opt != nullptr);
printer_extruder_id_opt->values.clear();
auto printer_extruder_variant_opt = dynamic_cast<ConfigOptionStrings*>(config.option("printer_extruder_variant"));
assert(printer_extruder_variant_opt != nullptr);
printer_extruder_variant_opt->values.clear();
for (int i = 0; i < num_extruders; i++) {
// `extruder_variant_list` specifies supported variant of each nozzle/extruder,
// each item is a comma separated list of variants (extruder type + nozzle flow type) this extruder supported
std::string variant = extruder_variant_opt->get_at(i);
std::vector<std::string> variants_list;
boost::split(variants_list, variant, boost::is_any_of(","), boost::token_compress_on);
if (!variants_list.empty()) {
printer_extruder_id_opt->values.insert(printer_extruder_id_opt->values.end(), variants_list.size(), i + 1);
printer_extruder_variant_opt->values.insert(printer_extruder_variant_opt->values.end(), variants_list.begin(), variants_list.end());
}
}
}
void DynamicPrintConfig::set_num_extruders(unsigned int num_extruders)
{
extend_extruder_variant(*this, num_extruders);
const auto &defaults = FullPrintConfig::defaults();
for (const std::string &key : print_config_def.extruder_option_keys()) {
if (key == "default_filament_profile")

View file

@ -2168,7 +2168,7 @@ static void triangulate_slice(
float z,
bool triangulate,
bool normals_down,
const std::map<int, Vec3f*> &section_vertices_map)
const std::map<int, Vec3f> &section_vertices_map)
{
sort_remove_duplicates(slice_vertices);
@ -2240,7 +2240,7 @@ static void triangulate_slice(
int idx = -1;
bool exist = false;
for (auto iter = section_vertices_map.begin(); iter != section_vertices_map.end(); iter++) {
if (is_equal(v, *iter->second)) {
if (is_equal(v, iter->second)) {
idx = iter->first;
exist = true;
break;
@ -2348,7 +2348,7 @@ void cut_mesh(const indexed_triangle_set& mesh, float z, indexed_triangle_set* u
IntersectionLines upper_lines, lower_lines;
std::vector<int> upper_slice_vertices, lower_slice_vertices;
std::vector<Vec3i32> facets_edge_ids = its_face_edge_ids(mesh);
std::map<int, Vec3f *> section_vertices_map;
std::map<int, Vec3f> section_vertices_map;
for (int facet_idx = 0; facet_idx < int(mesh.indices.size()); ++ facet_idx) {
const stl_triangle_vertex_indices &facet = mesh.indices[facet_idx];
@ -2357,8 +2357,8 @@ void cut_mesh(const indexed_triangle_set& mesh, float z, indexed_triangle_set* u
float max_z = std::max(vertices[0].z(), std::max(vertices[1].z(), vertices[2].z()));
for (size_t i = 0; i < 3; i++) {
if (is_equal(z, vertices[i].z()) && section_vertices_map[facet(i)] == nullptr) {
section_vertices_map[facet(i)] = new Vec3f(vertices[i].x(), vertices[i].y(), vertices[i].z());
if (is_equal(z, vertices[i].z()) && section_vertices_map.find(facet(i)) == section_vertices_map.end()) {
section_vertices_map.emplace(facet(i), vertices[i]);
}
}
// intersect facet with cutting plane
@ -2554,7 +2554,6 @@ void cut_mesh(const indexed_triangle_set& mesh, float z, indexed_triangle_set* u
}
#endif // NDEBUG
}
std::map<int, Vec3f*>().swap(section_vertices_map);
}
} // namespace Slic3r

View file

@ -57,32 +57,15 @@ void AMSMaterialsSetting::create()
m_sizer_button->Add(0, 0, 1, wxEXPAND, 0);
m_button_confirm = new Button(this, _L("Confirm"));
m_btn_bg_green = StateColor(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_confirm->SetBackgroundColor(m_btn_bg_green);
m_button_confirm->SetBorderColor(wxColour(0, 150, 136));
m_button_confirm->SetTextColor(wxColour("#FFFFFE"));
m_button_confirm->SetMinSize(AMS_MATERIALS_SETTING_BUTTON_SIZE);
m_button_confirm->SetCornerRadius(FromDIP(12));
m_button_confirm->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_confirm->Bind(wxEVT_BUTTON, &AMSMaterialsSetting::on_select_ok, this);
m_button_reset = new Button(this, _L("Reset"));
m_btn_bg_gray = StateColor(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(*wxWHITE, StateColor::Focused),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_reset->SetBackgroundColor(m_btn_bg_gray);
m_button_reset->SetBorderColor(AMS_MATERIALS_SETTING_GREY900);
m_button_reset->SetTextColor(AMS_MATERIALS_SETTING_GREY900);
m_button_reset->SetMinSize(AMS_MATERIALS_SETTING_BUTTON_SIZE);
m_button_reset->SetCornerRadius(FromDIP(12));
m_button_reset->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_reset->Bind(wxEVT_BUTTON, &AMSMaterialsSetting::on_select_reset, this);
m_button_close = new Button(this, _L("Close"));
m_button_close->SetBackgroundColor(m_btn_bg_gray);
m_button_close->SetBorderColor(AMS_MATERIALS_SETTING_GREY900);
m_button_close->SetTextColor(AMS_MATERIALS_SETTING_GREY900);
m_button_close->SetMinSize(AMS_MATERIALS_SETTING_BUTTON_SIZE);
m_button_close->SetCornerRadius(FromDIP(12));
m_button_close->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_close->Bind(wxEVT_BUTTON, &AMSMaterialsSetting::on_select_close, this);
m_sizer_button->Add(m_button_confirm, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(20));
@ -836,7 +819,7 @@ void AMSMaterialsSetting::update_widgets()
bool AMSMaterialsSetting::Show(bool show)
{
if (show) {
m_button_confirm->SetMinSize(AMS_MATERIALS_SETTING_BUTTON_SIZE);
m_button_confirm->Rescale(); // ORCA re applies size
m_input_nozzle_max->GetTextCtrl()->SetSize(wxSize(-1, FromDIP(20)));
m_input_nozzle_min->GetTextCtrl()->SetSize(wxSize(-1, FromDIP(20)));
//m_clr_picker->set_color(m_clr_picker->GetParent()->GetBackgroundColour());
@ -1193,9 +1176,7 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
if ( !this->obj || m_filament_selection < 0) {
m_input_k_val->Enable(false);
m_input_n_val->Enable(false);
m_button_confirm->Disable();
m_button_confirm->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_confirm->SetBorderColor(wxColour(0x90, 0x90, 0x90));
m_button_confirm->Disable(); // ORCA No need to change style
m_comboBox_cali_result->Clear();
m_comboBox_cali_result->SetValue(wxEmptyString);
m_input_k_val->GetTextCtrl()->SetValue(wxEmptyString);
@ -1204,10 +1185,7 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
return;
}
else {
m_button_confirm->SetBackgroundColor(m_btn_bg_green);
m_button_confirm->SetBorderColor(wxColour(0, 150, 136));
m_button_confirm->SetTextColor(wxColour("#FFFFFE"));
m_button_confirm->Enable(true);
m_button_confirm->Enable(true); // ORCA No need to change style
}
//filament id
@ -1357,12 +1335,9 @@ void AMSMaterialsSetting::on_dpi_changed(const wxRect &suggested_rect)
degree->msw_rescale();
bitmap_max_degree->SetBitmap(degree->bmp());
bitmap_min_degree->SetBitmap(degree->bmp());
m_button_reset->SetMinSize(AMS_MATERIALS_SETTING_BUTTON_SIZE);
m_button_reset->SetCornerRadius(FromDIP(12));
m_button_confirm->SetMinSize(AMS_MATERIALS_SETTING_BUTTON_SIZE);
m_button_confirm->SetCornerRadius(FromDIP(12));
m_button_close->SetMinSize(AMS_MATERIALS_SETTING_BUTTON_SIZE);
m_button_close->SetCornerRadius(FromDIP(12));
m_button_reset->Rescale(); // ORCA
m_button_confirm->Rescale(); // ORCA
m_button_close->Rescale(); // ORCA
this->Refresh();
}

View file

@ -39,25 +39,8 @@ BBLStatusBarSend::BBLStatusBarSend(wxWindow *parent, int id)
//StateColor btn_bd_white(std::pair<wxColour, int>(*wxWHITE, StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
StateColor btn_bt_white(std::pair<wxColour, int>(wxColour(0x90, 0x90, 0x90), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
StateColor btn_bd_white(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
StateColor btn_txt_white(std::pair<wxColour, int>(wxColour("#FFFFFE"), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Normal));
m_cancelbutton = new Button(m_self, _L("Cancel"));
m_cancelbutton->SetSize(wxSize(m_self->FromDIP(58), m_self->FromDIP(22)));
m_cancelbutton->SetMinSize(wxSize(m_self->FromDIP(58), m_self->FromDIP(22)));
m_cancelbutton->SetMaxSize(wxSize(m_self->FromDIP(58), m_self->FromDIP(22)));
m_cancelbutton->SetBackgroundColor(btn_bt_white);
m_cancelbutton->SetBorderColor(btn_bd_white);
m_cancelbutton->SetTextColor(btn_txt_white);
m_cancelbutton->SetCornerRadius(m_self->FromDIP(12));
m_cancelbutton->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_cancelbutton->Bind(wxEVT_BUTTON,
[this](wxCommandEvent &evt) {
cancel();

View file

@ -135,32 +135,14 @@ PingCodeBindDialog::PingCodeBindDialog(Plater* plater /*= nullptr*/)
wxBoxSizer* m_sizer_button = new wxBoxSizer(wxHORIZONTAL);
m_sizer_button->Add(0, 0, 1, wxEXPAND, 5);
m_button_bind = new Button(request_bind_panel, _L("Confirm"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_bind->SetBackgroundColor(btn_bg_green);
m_button_bind->SetBorderColor(*wxWHITE);
m_button_bind->SetTextColor(wxColour("#FFFFFE"));
m_button_bind->SetSize(BIND_DIALOG_BUTTON_SIZE);
m_button_bind->SetMinSize(BIND_DIALOG_BUTTON_SIZE);
m_button_bind->SetCornerRadius(FromDIP(12));
m_button_bind->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_bind->Enable(false);
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_cancel = new Button(request_bind_panel, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white);
m_button_cancel->SetBorderColor(BIND_DIALOG_GREY900);
m_button_cancel->SetSize(BIND_DIALOG_BUTTON_SIZE);
m_button_cancel->SetMinSize(BIND_DIALOG_BUTTON_SIZE);
m_button_cancel->SetTextColor(BIND_DIALOG_GREY900);
m_button_cancel->SetCornerRadius(FromDIP(12));
m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_sizer_button->Add(m_button_bind, 0, wxALIGN_CENTER, 0);
m_sizer_button->Add(0, 0, 0, wxLEFT, FromDIP(13));
m_sizer_button->Add(0, 0, 0, wxLEFT, ButtonProps::ChoiceButtonGap());
m_sizer_button->Add(m_button_cancel, 0, wxALIGN_CENTER, 0);
@ -179,7 +161,7 @@ PingCodeBindDialog::PingCodeBindDialog(Plater* plater /*= nullptr*/)
sizer_request->Add(0, 0, 0, wxTOP, FromDIP(5));
sizer_request->Add(ping_code_input, 0, wxLEFT, FromDIP(10));
sizer_request->Add(0, 0, 0, wxTOP, FromDIP(10));
sizer_request->Add(m_sizer_button, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, FromDIP(15));
sizer_request->Add(m_sizer_button, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, ButtonProps::ChoiceButtonGap());
request_bind_panel->SetSizer(sizer_request);
request_bind_panel->Layout();
request_bind_panel->Fit();
@ -197,12 +179,8 @@ PingCodeBindDialog::PingCodeBindDialog(Plater* plater /*= nullptr*/)
m_sizer_binding_button->Add(0, 0, 1, wxEXPAND, 5);
m_button_close = new Button(binding_panel, _L("Close"));
m_button_close->SetBackgroundColor(btn_bg_white);
m_button_close->SetBorderColor(BIND_DIALOG_GREY900);
m_button_close->SetSize(BIND_DIALOG_BUTTON_SIZE);
m_button_close->SetMinSize(BIND_DIALOG_BUTTON_SIZE);
m_button_close->SetTextColor(BIND_DIALOG_GREY900);
m_button_close->SetCornerRadius(FromDIP(12));
m_button_close->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_sizer_binding_button->Add(m_button_close, 0, wxALIGN_CENTER, 0);
auto sizer_binding = new wxBoxSizer(wxVERTICAL);
@ -211,7 +189,7 @@ PingCodeBindDialog::PingCodeBindDialog(Plater* plater /*= nullptr*/)
sizer_binding->Add(0, 0, 0, wxTOP, FromDIP(10));
sizer_binding->Add(m_loading_tip_txt, 0, wxALIGN_CENTER, 0);
sizer_binding->Add(0, 0, 0, wxTOP, FromDIP(30));
sizer_binding->Add(m_sizer_binding_button, 0, wxALIGN_RIGHT | wxRIGHT, FromDIP(20));
sizer_binding->Add(m_sizer_binding_button, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, ButtonProps::ChoiceButtonGap());
binding_panel->SetSizer(sizer_binding);
binding_panel->Layout();
binding_panel->Fit();
@ -484,7 +462,7 @@ PingCodeBindDialog::~PingCodeBindDialog() {
wxString txt = _L("Thank you for purchasing a Bambu Lab device. Before using your Bambu Lab device, please read the terms and conditions. "
"By clicking to agree to use your Bambu Lab device, you agree to abide by the Privacy Policy and Terms of Use (collectively, the \"Terms\"). "
"If you do not comply with or agree to the Bambu Lab Privacy Policy, please do not use Bambu Lab equipment and services.");
ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Terms and Conditions"), ConfirmBeforeSendDialog::ButtonStyle::ONLY_CONFIRM);
ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Terms and Conditions"), ConfirmBeforeSendDialog::VisibleButtons::ONLY_CONFIRM); // ORCA VisibleButtons instead ButtonStyle
confirm_dlg.update_text(txt);
confirm_dlg.CenterOnParent();
confirm_dlg.on_show();
@ -553,7 +531,7 @@ PingCodeBindDialog::~PingCodeBindDialog() {
"Personal Data by which an individual can be identified directly or indirectly, including "
"without limitation names, addresses, payment information, or phone numbers. By enabling "
"this service, you agree to these terms and the statement about Privacy Policy.");
ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Statement on User Experience Improvement Plan"), ConfirmBeforeSendDialog::ButtonStyle::ONLY_CONFIRM);
ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Statement on User Experience Improvement Plan"), ConfirmBeforeSendDialog::VisibleButtons::ONLY_CONFIRM); // ORCA VisibleButtons instead ButtonStyle
wxString model_id_text;
@ -683,35 +661,15 @@ PingCodeBindDialog::~PingCodeBindDialog() {
auto button_panel = new wxPanel(m_simplebook, wxID_ANY, wxDefaultPosition, BIND_DIALOG_BUTTON_PANEL_SIZE);
button_panel->SetBackgroundColour(*wxWHITE);
wxBoxSizer *m_sizer_button = new wxBoxSizer(wxHORIZONTAL);
m_sizer_button->Add(0, 0, 1, wxEXPAND, 5);
m_button_bind = new Button(button_panel, _L("Confirm"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_bind->SetBackgroundColor(btn_bg_green);
m_button_bind->SetBorderColor(*wxWHITE);
m_button_bind->SetTextColor(wxColour("#FFFFFE"));
m_button_bind->SetSize(BIND_DIALOG_BUTTON_SIZE);
m_button_bind->SetMinSize(BIND_DIALOG_BUTTON_SIZE);
m_button_bind->SetCornerRadius(FromDIP(12));
m_button_bind->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_bind->Enable(false);
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_cancel = new Button(button_panel, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white);
m_button_cancel->SetBorderColor(BIND_DIALOG_GREY900);
m_button_cancel->SetSize(BIND_DIALOG_BUTTON_SIZE);
m_button_cancel->SetMinSize(BIND_DIALOG_BUTTON_SIZE);
m_button_cancel->SetTextColor(BIND_DIALOG_GREY900);
m_button_cancel->SetCornerRadius(FromDIP(12));
m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_sizer_button->Add(m_button_bind, 0, wxALIGN_CENTER, 0);
m_sizer_button->Add(0, 0, 0, wxLEFT, FromDIP(13));
m_sizer_button->AddSpacer(ButtonProps::ChoiceButtonGap());
m_sizer_button->Add(m_button_cancel, 0, wxALIGN_CENTER, 0);
button_panel->SetSizer(m_sizer_button);
button_panel->Layout();
@ -730,8 +688,7 @@ PingCodeBindDialog::~PingCodeBindDialog() {
m_sizer_main->Add(m_panel_agreement, 0, wxALIGN_CENTER, 0);
m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(10));
m_sizer_main->Add(m_sw_bind_failed_info, 0, wxALIGN_CENTER, 0);
m_sizer_main->Add(m_simplebook, 0, wxALIGN_CENTER, 0);
m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(20));
m_sizer_main->Add(m_simplebook, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, ButtonProps::ChoiceButtonGap());
SetSizer(m_sizer_main);
Layout();
@ -891,8 +848,8 @@ PingCodeBindDialog::~PingCodeBindDialog() {
void BindMachineDialog::on_dpi_changed(const wxRect &suggested_rect)
{
m_button_bind->SetMinSize(BIND_DIALOG_BUTTON_SIZE);
m_button_cancel->SetMinSize(BIND_DIALOG_BUTTON_SIZE);
m_button_bind->Rescale(); // ORCA
m_button_cancel->Rescale(); // ORCA
}
void BindMachineDialog::update_machine_info(MachineObject* info)
@ -1040,34 +997,18 @@ UnBindMachineDialog::UnBindMachineDialog(Plater *plater /*= nullptr*/)
m_sizer_button->Add(0, 0, 1, wxEXPAND, 5);
m_button_unbind = new Button(this, _L("Confirm"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_unbind->SetBackgroundColor(btn_bg_green);
m_button_unbind->SetBorderColor(wxColour(0, 150, 136));
m_button_unbind->SetTextColor(wxColour("#FFFFFE"));
m_button_unbind->SetSize(BIND_DIALOG_BUTTON_SIZE);
m_button_unbind->SetMinSize(BIND_DIALOG_BUTTON_SIZE);
m_button_unbind->SetCornerRadius(FromDIP(12));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_unbind->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_cancel = new Button(this, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white);
m_button_cancel->SetBorderColor(BIND_DIALOG_GREY900);
m_button_cancel->SetSize(BIND_DIALOG_BUTTON_SIZE);
m_button_cancel->SetMinSize(BIND_DIALOG_BUTTON_SIZE);
m_button_cancel->SetTextColor(BIND_DIALOG_GREY900);
m_button_cancel->SetCornerRadius(FromDIP(12));
m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_sizer_button->Add(m_button_unbind, 0, wxALIGN_CENTER, 0);
m_sizer_button->Add(0, 0, 0, wxLEFT, FromDIP(13));
m_sizer_button->Add(0, 0, 0, wxLEFT, ButtonProps::ChoiceButtonGap());
m_sizer_button->Add(m_button_cancel, 0, wxALIGN_CENTER, 0);
m_sizer_main->Add(m_status_text, 0, wxALIGN_CENTER, 0);
m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(10));
m_sizer_main->Add(m_sizer_button, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(30));
m_sizer_main->Add(m_sizer_button, 0, wxALIGN_RIGHT | wxRIGHT, ButtonProps::ChoiceButtonGap());
m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(20));
SetSizer(m_sizer_main);
@ -1133,8 +1074,8 @@ void UnBindMachineDialog::on_unbind_printer(wxCommandEvent &event)
void UnBindMachineDialog::on_dpi_changed(const wxRect &suggested_rect)
{
m_button_unbind->SetMinSize(BIND_DIALOG_BUTTON_SIZE);
m_button_cancel->SetMinSize(BIND_DIALOG_BUTTON_SIZE);
m_button_unbind->Rescale(); // ORCA
m_button_cancel->Rescale(); // ORCA
}
void UnBindMachineDialog::on_show(wxShowEvent &event)

View file

@ -7,6 +7,7 @@
#include "format.hpp"
#include "MsgDialog.hpp"
#include "slic3r/Utils/CalibUtils.hpp"
#include "Widgets/DialogButtons.hpp"
#include <wx/gbsizer.h>
#include "Plater.hpp"
@ -114,15 +115,7 @@ HistoryWindow::HistoryWindow(wxWindow* parent, const std::vector<PACalibResult>&
scroll_window->SetSizer(scroll_sizer);
Button * mew_btn = new Button(scroll_window, _L("New"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
mew_btn->SetBackgroundColour(*wxWHITE);
mew_btn->SetBackgroundColor(btn_bg_green);
mew_btn->SetBorderColor(wxColour(0, 150, 136));
mew_btn->SetTextColor(wxColour("#FFFFFE"));
mew_btn->SetMinSize(wxSize(FromDIP(100), FromDIP(24)));
mew_btn->SetMaxSize(wxSize(FromDIP(100), FromDIP(24)));
mew_btn->SetCornerRadius(FromDIP(12));
mew_btn->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
mew_btn->Bind(wxEVT_BUTTON, &HistoryWindow::on_click_new_button, this);
scroll_sizer->Add(mew_btn, 0, wxLEFT, FromDIP(20));
@ -379,9 +372,7 @@ void HistoryWindow::sync_history_data() {
auto n_value = new Label(m_history_data_panel, n_str);
n_value->Hide();
auto delete_button = new Button(m_history_data_panel, _L("Delete"));
delete_button->SetBackgroundColour(*wxWHITE);
delete_button->SetMinSize(wxSize(-1, FromDIP(24)));
delete_button->SetCornerRadius(FromDIP(12));
delete_button->SetStyle(ButtonStyle::Alert, ButtonType::Window);
delete_button->Bind(wxEVT_BUTTON, [this, gbSizer, i, &result](auto& e) {
if (m_ui_op_lock) {
return;
@ -405,15 +396,7 @@ void HistoryWindow::sync_history_data() {
});
auto edit_button = new Button(m_history_data_panel, _L("Edit"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
edit_button->SetBackgroundColour(*wxWHITE);
edit_button->SetBackgroundColor(btn_bg_green);
edit_button->SetBorderColor(wxColour(0, 150, 136));
edit_button->SetTextColor(wxColour("#FFFFFE"));
edit_button->SetMinSize(wxSize(-1, FromDIP(24)));
edit_button->SetCornerRadius(FromDIP(12));
edit_button->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
edit_button->Bind(wxEVT_BUTTON, [this, result, k_value, name_value, edit_button](auto& e) {
if (m_ui_op_lock) return;
@ -580,29 +563,11 @@ EditCalibrationHistoryDialog::EditCalibrationHistoryDialog(wxWindow
panel_sizer->AddSpacer(FromDIP(25));
auto btn_sizer = new wxBoxSizer(wxHORIZONTAL);
Button* save_btn = new Button(top_panel, _L("Save"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
save_btn->SetBackgroundColour(*wxWHITE);
save_btn->SetBackgroundColor(btn_bg_green);
save_btn->SetBorderColor(wxColour(0, 150, 136));
save_btn->SetTextColor(wxColour("#FFFFFE"));
save_btn->SetMinSize(wxSize(-1, FromDIP(24)));
save_btn->SetCornerRadius(FromDIP(12));
Button* cancel_btn = new Button(top_panel, _L("Cancel"));
cancel_btn->SetBackgroundColour(*wxWHITE);
cancel_btn->SetMinSize(wxSize(-1, FromDIP(24)));
cancel_btn->SetCornerRadius(FromDIP(12));
save_btn->Bind(wxEVT_BUTTON, &EditCalibrationHistoryDialog::on_save, this);
cancel_btn->Bind(wxEVT_BUTTON, &EditCalibrationHistoryDialog::on_cancel, this);
btn_sizer->AddStretchSpacer();
btn_sizer->Add(save_btn);
btn_sizer->AddSpacer(FromDIP(20));
btn_sizer->Add(cancel_btn);
panel_sizer->Add(btn_sizer, 0, wxEXPAND, 0);
auto dlg_btns = new DialogButtons(top_panel, {"OK", "Cancel"});
dlg_btns->GetOK()->SetLabel(_L("Save"));
dlg_btns->GetOK()->Bind(wxEVT_BUTTON, &EditCalibrationHistoryDialog::on_save, this);
dlg_btns->GetCANCEL()->Bind(wxEVT_BUTTON, &EditCalibrationHistoryDialog::on_cancel, this);
panel_sizer->Add(dlg_btns, 0, wxEXPAND, 0);
main_sizer->Add(top_panel, 1, wxEXPAND | wxALL, FromDIP(20));
@ -844,27 +809,10 @@ NewCalibrationHistoryDialog::NewCalibrationHistoryDialog(wxWindow *parent, const
panel_sizer->AddSpacer(FromDIP(25));
auto btn_sizer = new wxBoxSizer(wxHORIZONTAL);
Button * ok_btn = new Button(top_panel, _L("OK"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
ok_btn->SetBackgroundColour(*wxWHITE);
ok_btn->SetBackgroundColor(btn_bg_green);
ok_btn->SetBorderColor(wxColour(0, 150, 136));
ok_btn->SetTextColor(wxColour("#FFFFFE"));
ok_btn->SetMinSize(wxSize(-1, FromDIP(24)));
ok_btn->SetCornerRadius(FromDIP(12));
Button *cancel_btn = new Button(top_panel, _L("Cancel"));
cancel_btn->SetBackgroundColour(*wxWHITE);
cancel_btn->SetMinSize(wxSize(-1, FromDIP(24)));
cancel_btn->SetCornerRadius(FromDIP(12));
ok_btn->Bind(wxEVT_BUTTON, &NewCalibrationHistoryDialog::on_ok, this);
cancel_btn->Bind(wxEVT_BUTTON, &NewCalibrationHistoryDialog::on_cancel, this);
btn_sizer->AddStretchSpacer();
btn_sizer->Add(ok_btn);
btn_sizer->AddSpacer(FromDIP(20));
btn_sizer->Add(cancel_btn);
panel_sizer->Add(btn_sizer, 0, wxEXPAND, 0);
auto dlg_btns = new DialogButtons(top_panel, {"OK", "Cancel"});
dlg_btns->GetOK()->Bind(wxEVT_BUTTON, &NewCalibrationHistoryDialog::on_ok, this);
dlg_btns->GetCANCEL()->Bind(wxEVT_BUTTON, &NewCalibrationHistoryDialog::on_cancel, this);
panel_sizer->Add(dlg_btns, 0, wxEXPAND, 0);
main_sizer->Add(top_panel, 1, wxEXPAND | wxALL, FromDIP(20));

View file

@ -141,16 +141,8 @@ CalibrationDialog::CalibrationDialog(Plater *plater)
m_calibration_flow->SetMinSize(wxSize(CALI_FLOW_CONTENT_WIDTH, FromDIP(160)));
m_calibration_flow->SetSize(wxSize(CALI_FLOW_CONTENT_WIDTH, FromDIP(160)));
StateColor btn_bg_green(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bd_green(std::pair<wxColour, int>(AMS_CONTROL_WHITE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Enabled));
m_calibration_btn = new Button(cali_right_panel, _L("Start Calibration"));
m_calibration_btn->SetBackgroundColor(btn_bg_green);
m_calibration_btn->SetBorderColor(btn_bd_green);
m_calibration_btn->SetTextColor(wxColour("#FFFFFE"));
m_calibration_btn->SetSize(wxSize(FromDIP(128), FromDIP(26)));
m_calibration_btn->SetMinSize(wxSize(FromDIP(128), FromDIP(26)));
m_calibration_btn->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
cali_right_sizer_v->Add(cali_text_right_top, 0, wxALIGN_CENTER, 0);
cali_right_sizer_v->Add(0, 0, 0, wxTOP, FromDIP(7));

View file

@ -42,13 +42,10 @@ CloneDialog::CloneDialog(wxWindow *parent)
m_progress->Hide();
bottom_sizer->Add(m_progress, 2, wxEXPAND | wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(10));
// used next button to get automatic left alignment
// will add a left_align_first_n parameter to DialogButtons. current method not good
auto dlg_btns = new DialogButtons(this, {"Next", "OK", "Cancel"});
auto dlg_btns = new DialogButtons(this, {"Fill", "OK", "Cancel"}, "", 1 /*left_aligned*/);
dlg_btns->GetNEXT()->SetLabel(_L("Fill"));
dlg_btns->GetNEXT()->SetToolTip(_L("Fill bed with copies"));
dlg_btns->GetNEXT()->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
dlg_btns->GetFIRST()->SetToolTip(_L("Fill bed with copies"));
dlg_btns->GetFIRST()->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
m_plater->fill_bed_with_instances();
EndModal(wxID_OK);
});
@ -63,7 +60,7 @@ CloneDialog::CloneDialog(wxWindow *parent)
m_progress->Show();
dlg_btns->GetOK()->Hide();
dlg_btns->GetNEXT()->Hide();
dlg_btns->GetFIRST()->Hide();
this->Layout();
v_sizer->Fit(this);

View file

@ -49,24 +49,7 @@ ConnectPrinterDialog::ConnectPrinterDialog(wxWindow *parent, wxWindowID id, cons
sizer_connect->Add(FromDIP(20), 0);
m_button_confirm = new Button(this, _L("Confirm"));
m_button_confirm->SetFont(Label::Body_12);
m_button_confirm->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_confirm->SetCornerRadius(FromDIP(12));
m_button_confirm->SetTextColor(wxColour("#FFFFFE"));
StateColor btn_bg(
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
StateColor btn_bd(std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor btn_text(std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal));
m_button_confirm->SetBackgroundColor(btn_bg);
m_button_confirm->SetBorderColor(btn_bd);
m_button_confirm->SetTextColor(btn_text);
m_button_confirm->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
sizer_connect->Add(m_button_confirm, 0, wxALL | wxALIGN_CENTER_VERTICAL, 0);
@ -193,8 +176,7 @@ void ConnectPrinterDialog::on_dpi_changed(const wxRect &suggested_rect)
m_textCtrl_code->GetTextCtrl()->SetSize(wxSize(-1, FromDIP(22)));
m_textCtrl_code->GetTextCtrl()->SetMinSize(wxSize(-1, FromDIP(22)));
m_button_confirm->SetCornerRadius(FromDIP(12));
m_button_confirm->Rescale();
m_button_confirm->Rescale(); // ORCA No need to set style again
Layout();
this->Refresh();

View file

@ -2737,7 +2737,7 @@ wxBoxSizer *CreatePrinterPresetDialog::create_presets_template_item(wxWindow *pa
wxWindow *CreatePrinterPresetDialog::create_page2_dialog_buttons(wxWindow *parent)
{
auto dlg_btns = new DialogButtons(parent, {"Return", "OK", "Cancel"});
auto dlg_btns = new DialogButtons(parent, {"Return", "OK", "Cancel"}, "", 1 /*left_aligned*/);
dlg_btns->GetRETURN()->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) { show_page1(); });
@ -4741,9 +4741,9 @@ wxBoxSizer *EditFilamentPresetDialog::create_preset_tree_sizer()
wxWindow *EditFilamentPresetDialog::create_dialog_buttons()
{
auto dlg_btns = new DialogButtons(this, {"Delete", "OK"});
auto dlg_btns = new DialogButtons(this, {"Delete", "OK"}, "", 1 /*left_aligned*/);
dlg_btns->GetButtonFromID(wxID_DELETE)->Bind(wxEVT_BUTTON, ([this](wxCommandEvent &e) {
dlg_btns->GetFIRST()->Bind(wxEVT_BUTTON, ([this](wxCommandEvent &e) {
WarningDialog dlg(this, _L("All the filament presets belong to this filament would be deleted.\n"
"If you are using this filament on your printer, please reset the filament information for that slot."),
_L("Delete filament"), wxYES | wxCANCEL | wxCANCEL_DEFAULT | wxCENTRE);

View file

@ -4319,7 +4319,7 @@ int MachineObject::parse_json(std::string tunnel, std::string payload, bool key_
void MachineObject::set_ctt_dlg( wxString text){
if (!m_set_ctt_dlg) {
m_set_ctt_dlg = true;
auto print_error_dlg = new GUI::SecondaryCheckDialog(nullptr, wxID_ANY, _L("Warning"), GUI::SecondaryCheckDialog::ButtonStyle::ONLY_CONFIRM);
auto print_error_dlg = new GUI::SecondaryCheckDialog(nullptr, wxID_ANY, _L("Warning"), GUI::SecondaryCheckDialog::VisibleButtons::ONLY_CONFIRM); // ORCA VisibleButtons instead ButtonStyle
print_error_dlg->update_text(text);
print_error_dlg->Bind(wxEVT_SHOW, [this](auto& e) {
if (!e.IsShown()) {

View file

@ -171,37 +171,16 @@ void ExtrusionCalibration::create()
m_error_text->Hide();
m_button_cali = new Button(m_step_1_panel, _L("Start calibration"));
m_btn_bg_green = StateColor(std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Disabled), std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_cali->SetBackgroundColor(m_btn_bg_green);
m_button_cali->SetFont(Label::Body_13);
m_button_cali->SetBorderColor({ std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Disabled), std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Enabled) });
m_button_cali->SetTextColor({ std::pair<wxColour, int>(wxColour(172, 172, 172), StateColor::Disabled), std::pair<wxColour, int>(EXTRUSION_CALIBRATION_GREY200, StateColor::Enabled) });
m_button_cali->SetCornerRadius(FromDIP(12));
m_button_cali->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_cali->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_cali->Bind(wxEVT_BUTTON, &ExtrusionCalibration::on_click_cali, this);
m_cali_cancel = new Button(m_step_1_panel, _L("Cancel"));
m_btn_bg_green = StateColor(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_cali_cancel->SetBackgroundColor(m_btn_bg_green);
m_cali_cancel->SetBorderColor(wxColour(0, 150, 136));
m_cali_cancel->SetTextColor(EXTRUSION_CALIBRATION_GREY200);
m_cali_cancel->SetMinSize(EXTRUSION_CALIBRATION_BUTTON_SIZE);
m_cali_cancel->SetCornerRadius(FromDIP(12));
m_cali_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_cali_cancel->Hide();
m_cali_cancel->Bind(wxEVT_BUTTON, &ExtrusionCalibration::on_click_cancel, this);
m_button_next_step = new Button(m_step_1_panel, _L("Next"));
m_btn_bg_gray = StateColor(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(*wxWHITE, StateColor::Focused),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_next_step->SetBackgroundColor(m_btn_bg_gray);
m_button_next_step->SetFont(Label::Body_13);
m_button_next_step->SetBorderColor(EXTRUSION_CALIBRATION_GREY900);
m_button_next_step->SetTextColor(EXTRUSION_CALIBRATION_GREY900);
m_button_next_step->SetMinSize(EXTRUSION_CALIBRATION_BUTTON_SIZE);
m_button_next_step->SetCornerRadius(FromDIP(12));
m_button_next_step->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_next_step->Bind(wxEVT_BUTTON, &ExtrusionCalibration::on_click_next, this);
m_button_next_step->Hide();
@ -257,23 +236,11 @@ void ExtrusionCalibration::create()
// save button
m_button_save_result = new Button(m_step_2_panel, _L("Save"));
m_btn_bg_green = StateColor(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_save_result->SetBackgroundColor(m_btn_bg_green);
m_button_save_result->SetFont(Label::Body_13);
m_button_save_result->SetBorderColor(wxColour(0, 150, 136));
m_button_save_result->SetTextColor(EXTRUSION_CALIBRATION_GREY200);
m_button_save_result->SetMinSize(EXTRUSION_CALIBRATION_BUTTON_SIZE);
m_button_save_result->SetCornerRadius(FromDIP(12));
m_button_save_result->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_save_result->Bind(wxEVT_BUTTON, &ExtrusionCalibration::on_click_save, this);
m_button_last_step = new Button(m_step_2_panel, _L("Last Step")); // Back for english
m_button_last_step->SetBackgroundColor(m_btn_bg_gray);
m_button_last_step->SetFont(Label::Body_13);
m_button_last_step->SetBorderColor(EXTRUSION_CALIBRATION_GREY900);
m_button_last_step->SetTextColor(EXTRUSION_CALIBRATION_GREY900);
m_button_last_step->SetMinSize(EXTRUSION_CALIBRATION_BUTTON_SIZE);
m_button_last_step->SetCornerRadius(FromDIP(12));
m_button_last_step->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_last_step->Bind(wxEVT_BUTTON, &ExtrusionCalibration::on_click_last, this);

View file

@ -91,9 +91,6 @@ protected:
int get_bed_temp(DynamicPrintConfig* config);
protected:
StateColor m_btn_bg_green;
StateColor m_btn_bg_gray;
wxPanel* m_step_1_panel;
wxPanel* m_step_2_panel;

View file

@ -7,6 +7,7 @@
#include "Widgets/Label.hpp"
#include "Widgets/Button.hpp"
#include "Widgets/StateColor.hpp"
#include "Widgets/DialogButtons.hpp"
#include "wxExtensions.hpp"
#include <wx/wx.h>
#include <wx/sizer.h>
@ -97,8 +98,11 @@ FilamentPickerDialog::FilamentPickerDialog(wxWindow *parent, const wxString& fil
main_sizer->AddSpacer(FromDIP(8));
// OK / Cancel buttons
wxBoxSizer* btn_sizer = CreateButtonPanel();
main_sizer->Add(btn_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(10));
auto dlg_btns = new DialogButtons(this, {"OK", "Cancel"});
m_ok_btn = dlg_btns->GetOK();
m_cancel_btn = dlg_btns->GetCANCEL();
main_sizer->Add(dlg_btns, 0, wxEXPAND);
container_sizer->Add(main_sizer, 1, wxEXPAND | wxALL, FromDIP(16));
SetSizer(container_sizer);
@ -542,61 +546,6 @@ void FilamentPickerDialog::CreateMoreInfoButton()
m_more_btn->SetCornerRadius(FromDIP(0));
}
wxBoxSizer* FilamentPickerDialog::CreateButtonPanel()
{
wxBoxSizer* btn_sizer = new wxBoxSizer(wxHORIZONTAL);
// Add spacer to push buttons to the right
btn_sizer->AddStretchSpacer();
// standard button color style
StateColor btn_bg_green(
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
StateColor btn_bd_green(
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
StateColor btn_text_green(
std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Normal)
);
StateColor btn_bg_white(
std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal)
);
StateColor btn_bd_white(
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Normal)
);
StateColor btn_text_white(
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Normal)
);
// Create Cancel button using project's Button class
m_cancel_btn = new Button(this, _L("Cancel"), "", 0, 0, wxID_CANCEL);
m_cancel_btn->SetMinSize(wxSize(FromDIP(55), FromDIP(24)));
m_cancel_btn->SetCornerRadius(FromDIP(12));
m_cancel_btn->SetBackgroundColor(btn_bg_white);
m_cancel_btn->SetBorderColor(btn_bd_white);
m_cancel_btn->SetTextColor(btn_text_white);
btn_sizer->Add(m_cancel_btn, 0, wxEXPAND, 0);
btn_sizer->AddSpacer(FromDIP(10));
// Create OK button using project's Button class
m_ok_btn = new Button(this, _L("OK"), "", 0, 0, wxID_OK);
m_ok_btn->SetMinSize(wxSize(FromDIP(55), FromDIP(24)));
m_ok_btn->SetCornerRadius(FromDIP(12));
m_ok_btn->SetBackgroundColor(btn_bg_green);
m_ok_btn->SetBorderColor(btn_bd_green);
m_ok_btn->SetTextColor(btn_text_green);
m_ok_btn->SetFocus();
btn_sizer->Add(m_ok_btn, 0, wxEXPAND, 0);
return btn_sizer;
}
wxColourData FilamentPickerDialog::GetSingleColorData()
{
wxColourData data;

View file

@ -55,7 +55,6 @@ private:
wxScrolledWindow* CreateColorGrid();
wxBoxSizer* CreateSeparatorLine();
void CreateMoreInfoButton();
wxBoxSizer* CreateButtonPanel();
void BindEvents();
// Preview panel helper methods

View file

@ -870,15 +870,23 @@ void GCodeViewer::init(ConfigOptionMode mode, PresetBundle* preset_bundle)
if (preset_bundle)
m_nozzle_nums = preset_bundle->get_printer_extruder_count();
bool multimaterial = preset_bundle->filament_presets.empty() ? 0 : preset_bundle->filament_presets.size() > 1;
// set to color print by default if use multi extruders
if (m_nozzle_nums > 1) {
m_view_type_sel = std::distance(view_type_items.begin(),std::find(view_type_items.begin(), view_type_items.end(), EViewType::Summary));
m_view_type_sel = std::distance(view_type_items.begin(),
std::find(view_type_items.begin(), view_type_items.end(), EViewType::Summary));
set_view_type(EViewType::Summary);
} else {
m_view_type_sel = std::distance(view_type_items.begin(),std::find(view_type_items.begin(), view_type_items.end(), EViewType::ColorPrint));
} else if (multimaterial) {
m_view_type_sel = std::distance(view_type_items.begin(),
std::find(view_type_items.begin(), view_type_items.end(), EViewType::ColorPrint));
set_view_type(EViewType::ColorPrint);
} else {
m_view_type_sel = std::distance(view_type_items.begin(),
std::find(view_type_items.begin(), view_type_items.end(), EViewType::FeatureType));
set_view_type(EViewType::FeatureType);
}
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": finished");
}

View file

@ -240,6 +240,10 @@ void GLCanvas3D::LayersEditing::show_tooltip_information(const GLCanvas3D& canva
caption_max += GImGui->Style.WindowPadding.x + imgui.scaled(1);
float scale = canvas.get_scale();
#ifdef WIN32
int dpi = get_dpi_for_window(wxGetApp().GetTopWindow());
scale *= (float) dpi / (float) DPI_DEFAULT;
#endif // WIN32
ImVec2 button_size = ImVec2(25 * scale, 25 * scale); // ORCA: Use exact resolution will prevent blur on icon
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {0, 0}); // ORCA: Dont add padding
@ -8869,6 +8873,10 @@ float GLCanvas3D::_show_assembly_tooltip_information(float caption_max, float x,
caption_max += imgui->calc_text_size(": "sv).x + 35.f;
float scale = get_scale();
#ifdef WIN32
int dpi = get_dpi_for_window(wxGetApp().GetTopWindow());
scale *= (float) dpi / (float) DPI_DEFAULT;
#endif // WIN32
ImVec2 button_size = ImVec2(25 * scale, 25 * scale); // ORCA: Use exact resolution will prevent blur on icon
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);

View file

@ -533,7 +533,7 @@ wxMenu* MenuFactory::append_submenu_add_generic(wxMenu* menu, ModelVolumeType ty
wxMenu* MenuFactory::append_submenu_add_handy_model(wxMenu* menu, ModelVolumeType type) {
auto sub_menu = new wxMenu;
for (auto &item : {L("Orca Cube"), L("Orca Tolerance Test"), L("3DBenchy"), L("Autodesk FDM Test"),
for (auto &item : {L("Orca Cube"), L("Orca Tolerance Test"), L("3DBenchy"), L("Cali Cat"), L("Autodesk FDM Test"),
L("Voron Cube"), L("Stanford Bunny"), L("Orca String Hell") }) {
append_menu_item(
sub_menu, wxID_ANY, _(item), "",
@ -547,6 +547,8 @@ wxMenu* MenuFactory::append_submenu_add_handy_model(wxMenu* menu, ModelVolumeTyp
file_name = "OrcaToleranceTest.stl";
else if (file_name == L("3DBenchy"))
file_name = "3DBenchy.3mf";
else if (file_name == L("Cali Cat"))
file_name = "calicat.stl";
else if (file_name == L("Autodesk FDM Test"))
file_name = "ksr_fdmtest_v4.3mf";
else if (file_name == L("Voron Cube"))

View file

@ -216,8 +216,8 @@ bool ObjectTableSettings::update_settings_list(bool is_object, bool is_multiple_
};
auto optgroup = std::make_shared<ConfigOptionsGroup>(m_og->ctrl_parent(), _(cat.first), &m_current_config, false, extra_column);
optgroup->label_width = 15;
optgroup->sidetext_width = 5;
optgroup->label_width = 20; // ORCA match label width with sidebar
optgroup->sidetext_width = Field::def_width_thinner();
optgroup->set_config_category_and_type(GUI::from_u8(group_category), Preset::TYPE_PRINT);
std::weak_ptr<ConfigOptionsGroup> weak_optgroup(optgroup);
@ -246,7 +246,7 @@ bool ObjectTableSettings::update_settings_list(bool is_object, bool is_multiple_
for (auto& opt : cat.second)
{
Option option = optgroup->get_option(opt.name);
option.opt.width = 18;
option.opt.width = Field::def_width_wider(); // ORCA match parameter box width
if (is_extruders_cat)
option.opt.max = wxGetApp().extruders_edited_cnt();
optgroup->append_single_option_line(option);

View file

@ -802,6 +802,10 @@ void GLGizmoBrimEars::show_tooltip_information(float x, float y)
caption_max += m_imgui->calc_text_size(": "sv).x + 35.f;
float scale = m_parent.get_scale();
#ifdef WIN32
int dpi = get_dpi_for_window(wxGetApp().GetTopWindow());
scale *= (float) dpi / (float) DPI_DEFAULT;
#endif // WIN32
ImVec2 button_size = ImVec2(25 * scale, 25 * scale); // ORCA: Use exact resolution will prevent blur on icon
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {0, 0}); // ORCA: Dont add padding

View file

@ -224,6 +224,8 @@ GLGizmoCut3D::GLGizmoCut3D(GLCanvas3D& parent, const std::string& icon_filename,
{"Width" , _u8L("Width")},
{"Flap Angle" , _u8L("Flap Angle")},
{"Groove Angle" , _u8L("Groove Angle")},
{"Cut position" , _u8L("Cut position")}, // ORCA
{"Build Volume" , _u8L("Build Volume")}, // ORCA
};
// update_connector_shape();
@ -660,10 +662,11 @@ bool GLGizmoCut3D::render_reset_button(const std::string& label_id, const std::s
const ImGuiStyle &style = ImGui::GetStyle();
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, {1, style.ItemSpacing.y});
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0); // ORCA match button style
ImGui::PushStyleColor(ImGuiCol_Button, {0.25f, 0.25f, 0.25f, 0.0f});
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, {0.4f, 0.4f, 0.4f, 1.0f});
ImGui::PushStyleColor(ImGuiCol_ButtonActive, {0.4f, 0.4f, 0.4f, 1.0f});
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, {0, 0, 0, 0}); // ORCA match button style
ImGui::PushStyleColor(ImGuiCol_ButtonActive, {0, 0, 0, 0}); // ORCA match button style
const bool revert = m_imgui->button(wxString(ImGui::RevertBtn) + "##" + wxString::FromUTF8(label_id));
@ -672,7 +675,7 @@ bool GLGizmoCut3D::render_reset_button(const std::string& label_id, const std::s
if (ImGui::IsItemHovered())
m_imgui->tooltip(tooltip.c_str(), ImGui::GetFontSize() * 20.0f);
ImGui::PopStyleVar();
ImGui::PopStyleVar(2); // ORCA
return revert;
}
@ -2254,7 +2257,7 @@ void GLGizmoCut3D::render_connectors_input_window(CutConnectors &connectors, flo
render_flip_plane_button(m_connectors_editing && connectors.empty());
m_imgui->text(m_labels_map["Type"]);
ImGuiWrapper::push_radio_style();
ImGuiWrapper::push_radio_style(m_parent.get_scale()); // ORCA
bool type_changed = render_connect_type_radio_button(CutConnectorType::Plug);
type_changed |= render_connect_type_radio_button(CutConnectorType::Dowel);
type_changed |= render_connect_type_radio_button(CutConnectorType::Snap);
@ -2334,18 +2337,14 @@ void GLGizmoCut3D::render_connectors_input_window(CutConnectors &connectors, flo
void GLGizmoCut3D::render_build_size()
{
double koef = m_imperial_units ? GizmoObjectManipulation::mm_to_in : 1.0;
wxString unit_str = " " + (m_imperial_units ? _L("in") : _L("mm"));
Vec3d tbb_sz = m_transformed_bounding_box.size();
wxString size = "X: " + double_to_string(tbb_sz.x() * koef, 2) + unit_str +
", Y: " + double_to_string(tbb_sz.y() * koef, 2) + unit_str +
", Z: " + double_to_string(tbb_sz.z() * koef, 2) + unit_str;
double koef = m_imperial_units ? GizmoObjectManipulation::mm_to_in : 1.0;
wxString unit_str = m_imperial_units ? _L("in") : _L("mm");
Vec3d tbb_sz = m_transformed_bounding_box.size() * koef; // ORCA
ImGui::AlignTextToFramePadding();
m_imgui->text(_L("Build Volume"));
ImGui::SameLine();
m_imgui->text_colored(ImGuiWrapper::COL_ORANGE_LIGHT, size);
ImGui::SameLine(m_label_width);
ImGui::Text("%.2f x %.2f x %.2f %s", tbb_sz.x(), tbb_sz.y(), tbb_sz.z(), unit_str.ToUTF8().data()); // ORCA use regular text color and simplify format
}
void GLGizmoCut3D::reset_cut_plane()
@ -2650,8 +2649,8 @@ void GLGizmoCut3D::render_cut_plane_input_window(CutConnectors &connectors, floa
render_build_size();
ImGui::AlignTextToFramePadding();
m_imgui->text(_L("Cut position") + ": ");
ImGui::SameLine();
m_imgui->text(_L("Cut position"));
ImGui::SameLine(m_label_width);
render_move_center_input(Z);
ImGui::SameLine();
@ -2933,6 +2932,10 @@ void GLGizmoCut3D::show_tooltip_information(float x, float y)
caption_max += m_imgui->calc_text_size(std::string_view{": "}).x + 35.f;
float scale = m_parent.get_scale();
#ifdef WIN32
int dpi = get_dpi_for_window(wxGetApp().GetTopWindow());
scale *= (float) dpi / (float) DPI_DEFAULT;
#endif // WIN32
ImVec2 button_size = ImVec2(25 * scale, 25 * scale); // ORCA: Use exact resolution will prevent blur on icon
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {0, 0}); // ORCA: Dont add padding

View file

@ -1535,7 +1535,7 @@ void GLGizmoEmboss::draw_text_input()
float width = ImGui::GetContentRegionAvailWidth();
const ImVec2& padding = style.FramePadding;
ImVec2 icon_pos(width - m_gui_cfg->icon_width - scrollbar_width + padding.x,
cursor.y - m_gui_cfg->icon_width - scrollbar_height - 2*padding.y);
cursor.y - 2 * m_gui_cfg->icon_width - scrollbar_height - 2*padding.y); // ORCA fix vertical position
ImGui::SetCursorPos(icon_pos);
draw(get_icon(m_icons, IconType::exclamation, IconState::hovered));
@ -1646,7 +1646,7 @@ void GLGizmoEmboss::draw_font_list_line()
bool exist_change_in_font = m_style_manager.is_font_changed();
const std::string& font_text = m_gui_cfg->translations.font;
if (exist_change_in_font || !exist_stored_style)
ImGuiWrapper::text_colored(ImGuiWrapper::COL_ORCA, font_text);
ImGuiWrapper::text_colored(ImGuiWrapper::COL_MODIFIED, font_text); // ORCA match color
else
ImGuiWrapper::text(font_text);
@ -1673,7 +1673,8 @@ void GLGizmoEmboss::draw_font_list_line()
EmbossStyle &style = m_style_manager.get_style();
if (exist_change_in_font) {
ImGui::SameLine(ImGui::GetStyle().WindowPadding.x);
if (draw_button(m_icons, IconType::undo)) {
auto r_icon = get_icon(m_icons, IconType::undo, IconState::hovered);
if (Slic3r::GUI::button(r_icon, r_icon, r_icon)) { // ORCA draw bottom with same orange color
const EmbossStyle *stored_style = m_style_manager.get_stored_style();
style.path = stored_style->path;
@ -1848,7 +1849,7 @@ void GLGizmoEmboss::draw_model_type()
ModelVolumeType type = m_volume->type();
//TRN EmbossOperation
ImGuiWrapper::push_radio_style();
ImGuiWrapper::push_radio_style(m_parent.get_scale()); // ORCA
if (ImGui::RadioButton(_u8L("Join").c_str(), type == part))
new_type = part;
else if (ImGui::IsItemHovered())
@ -2405,7 +2406,7 @@ bool GLGizmoEmboss::revertible(const std::string &name,
ImGui::AlignTextToFramePadding();
bool changed = exist_change(value, default_value);
if (changed || default_value == nullptr)
ImGuiWrapper::text_colored(ImGuiWrapper::COL_ORCA, name);
ImGuiWrapper::text_colored(ImGuiWrapper::COL_MODIFIED, name); // ORCA Match color
else
ImGuiWrapper::text(name);
@ -2414,7 +2415,8 @@ bool GLGizmoEmboss::revertible(const std::string &name,
ImGuiWindow *window = ImGui::GetCurrentWindow();
float prev_x = window->DC.CursorPosPrevLine.x;
ImGui::SameLine(undo_offset); // change cursor postion
if (draw_button(m_icons, IconType::undo)) {
auto r_icon = get_icon(m_icons, IconType::undo, IconState::hovered);
if (Slic3r::GUI::button(r_icon, r_icon, r_icon)) { // ORCA draw bottom with same orange color
value = *default_value;
// !! Fix to detect change of value after revert of float-slider
@ -2717,7 +2719,8 @@ void GLGizmoEmboss::draw_advanced()
else if (draw_button(icons, IconType::align_horizontal_right)) { align.first=FontProp::HorizontalAlign::right; is_change = true; }
else if (ImGui::IsItemHovered()) m_imgui->tooltip(_CTX_utf8(L_CONTEXT("Right", "Alignment"), "Alignment"), m_gui_cfg->max_tooltip_width);
ImGui::SameLine();
ImGui::SameLine(0, ImGui::GetStyle().ItemSpacing.x * 2.f); // ORCA use wider spacing for separation between horizontal / vertical alignment
if (align.second==FontProp::VerticalAlign::top) draw(get_icon(icons, IconType::align_vertical_top, IconState::hovered));
else if (draw_button(icons, IconType::align_vertical_top)) { align.second=FontProp::VerticalAlign::top; is_change = true; }
else if (ImGui::IsItemHovered()) m_imgui->tooltip(_CTX_utf8(L_CONTEXT("Top", "Alignment"), "Alignment"), m_gui_cfg->max_tooltip_width);

View file

@ -479,6 +479,10 @@ void GLGizmoFdmSupports::show_tooltip_information(float caption_max, float x, fl
caption_max += m_imgui->calc_text_size(std::string_view{": "}).x + 15.f;
float scale = m_parent.get_scale();
#ifdef WIN32
int dpi = get_dpi_for_window(wxGetApp().GetTopWindow());
scale *= (float) dpi / (float) DPI_DEFAULT;
#endif // WIN32
ImVec2 button_size = ImVec2(25 * scale, 25 * scale); // ORCA: Use exact resolution will prevent blur on icon
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {0, 0}); // ORCA: Dont add padding

View file

@ -88,6 +88,10 @@ void GLGizmoFuzzySkin::show_tooltip_information(float caption_max, float x, floa
caption_max += m_imgui->calc_text_size(std::string_view{": "}).x + 15.f;
float scale = m_parent.get_scale();
#ifdef WIN32
int dpi = get_dpi_for_window(wxGetApp().GetTopWindow());
scale *= (float) dpi / (float) DPI_DEFAULT;
#endif // WIN32
ImVec2 button_size = ImVec2(25 * scale, 25 * scale); // ORCA: Use exact resolution will prevent blur on icon
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {0, 0}); // ORCA: Dont add padding

View file

@ -2231,6 +2231,10 @@ void GLGizmoMeasure::show_tooltip_information(float caption_max, float x, float
caption_max += m_imgui->calc_text_size(": "sv).x + 35.f;
float scale = m_parent.get_scale();
#ifdef WIN32
int dpi = get_dpi_for_window(wxGetApp().GetTopWindow());
scale *= (float) dpi / (float) DPI_DEFAULT;
#endif // WIN32
ImVec2 button_size = ImVec2(25 * scale, 25 * scale); // ORCA: Use exact resolution will prevent blur on icon
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, { 0, 0 }); // ORCA: Dont add padding

View file

@ -287,6 +287,10 @@ void GLGizmoMmuSegmentation::show_tooltip_information(float caption_max, float x
caption_max += m_imgui->calc_text_size(std::string_view{": "}).x + 15.f;
float scale = m_parent.get_scale();
#ifdef WIN32
int dpi = get_dpi_for_window(wxGetApp().GetTopWindow());
scale *= (float) dpi / (float) DPI_DEFAULT;
#endif // WIN32
ImVec2 button_size = ImVec2(25 * scale, 25 * scale); // ORCA: Use exact resolution will prevent blur on icon
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {0, 0}); // ORCA: Dont add padding

View file

@ -436,7 +436,8 @@ bool reset_button(const IconManager::VIcons &icons)
//btn_label += ImGui::RevertButton;
//return ImGui::Button((btn_label + "##" + label_id).c_str());
return draw_clickable(icons, IconType::reset_value);
auto icon = get_icon(icons, IconType::reset_value, IconState::hovered);
return clickable(icon, icon); // ORCA use orange color for both states
}
} // namespace
@ -1666,7 +1667,9 @@ void GLGizmoSVG::draw_depth()
void GLGizmoSVG::draw_size()
{
ImGui::AlignTextToFramePadding();
ImGuiWrapper::text(m_gui_cfg->translations.size);
bool can_reset = m_scale_width.has_value() || m_scale_height.has_value();
ImVec4 text_color = can_reset ? ImGuiWrapper::COL_MODIFIED : ImGui::GetStyleColorVec4(ImGuiCol_Text); // ORCA use modified color on text
ImGuiWrapper::text_colored(text_color, m_gui_cfg->translations.size);
if (ImGui::IsItemHovered()){
size_t count_points = 0;
for (const auto &s : m_volume_shape.shapes_with_ids)
@ -1770,7 +1773,7 @@ void GLGizmoSVG::draw_size()
// reset button
bool can_reset = m_scale_width.has_value() || m_scale_height.has_value();
//bool can_reset = m_scale_width.has_value() || m_scale_height.has_value(); // ORCA update variable above if condition change
if (can_reset) {
if (reset_button(m_icons)) {
new_relative_scale = Vec3d(1./m_scale_width.value_or(1.f), 1./m_scale_height.value_or(1.f), 1.);
@ -1838,7 +1841,8 @@ void GLGizmoSVG::draw_distance()
ScopeGuard sg([imgui = m_imgui]() { imgui->disabled_end(); });
ImGui::AlignTextToFramePadding();
ImGuiWrapper::text(m_gui_cfg->translations.distance);
ImVec4 text_color = m_distance.has_value() ? ImGuiWrapper::COL_MODIFIED : ImGui::GetStyleColorVec4(ImGuiCol_Text); // ORCA use modified color on text
ImGuiWrapper::text_colored(text_color, m_gui_cfg->translations.distance);
ImGui::SameLine(m_gui_cfg->input_offset);
ImGui::SetNextItemWidth(m_gui_cfg->input_width);
@ -1881,7 +1885,8 @@ void GLGizmoSVG::draw_distance()
void GLGizmoSVG::draw_rotation()
{
ImGui::AlignTextToFramePadding();
ImGuiWrapper::text(m_gui_cfg->translations.rotation);
ImVec4 text_color = m_angle.has_value() ? ImGuiWrapper::COL_MODIFIED : ImGui::GetStyleColorVec4(ImGuiCol_Text); // ORCA use modified color on text
ImGuiWrapper::text_colored(text_color, m_gui_cfg->translations.rotation);
ImGui::SameLine(m_gui_cfg->input_offset);
ImGui::SetNextItemWidth(m_gui_cfg->input_width);
@ -2001,7 +2006,7 @@ void GLGizmoSVG::draw_model_type()
ModelVolumeType type = m_volume->type();
//TRN EmbossOperation
ImGuiWrapper::push_radio_style();
ImGuiWrapper::push_radio_style(m_parent.get_scale()); //ORCA
if (ImGui::RadioButton(_u8L("Join").c_str(), type == part))
new_type = part;
else if (ImGui::IsItemHovered())

View file

@ -109,6 +109,10 @@ void GLGizmoSeam::show_tooltip_information(float caption_max, float x, float y)
caption_max += m_imgui->calc_text_size(std::string_view{": "}).x + 35.f;
float scale = m_parent.get_scale();
#ifdef WIN32
int dpi = get_dpi_for_window(wxGetApp().GetTopWindow());
scale *= (float) dpi / (float) DPI_DEFAULT;
#endif // WIN32
ImVec2 button_size = ImVec2(25 * scale, 25 * scale); // ORCA: Use exact resolution will prevent blur on icon
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {0, 0}); // ORCA: Dont add padding

View file

@ -251,22 +251,22 @@ bool GLGizmosManager::init_icon_textures()
ImTextureID texture_id;
icon_list.clear();
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/toolbar_reset.svg", 14, 14, texture_id))
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/toolbar_reset.svg", 16, 16, texture_id))
icon_list.insert(std::make_pair((int)IC_TOOLBAR_RESET, texture_id));
else
return false;
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/toolbar_reset_hover.svg", 14, 14, texture_id))
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/toolbar_reset_hover.svg", 16, 16, texture_id))
icon_list.insert(std::make_pair((int)IC_TOOLBAR_RESET_HOVER, texture_id));
else
return false;
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/toolbar_reset_zero.svg", 14, 14, texture_id))
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/toolbar_reset_zero.svg", 16, 16, texture_id))
icon_list.insert(std::make_pair((int) IC_TOOLBAR_RESET_ZERO, texture_id));
else
return false;
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/toolbar_reset_zero_hover.svg", 14, 14, texture_id))
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/toolbar_reset_zero_hover.svg", 16, 16, texture_id))
icon_list.insert(std::make_pair((int) IC_TOOLBAR_RESET_ZERO_HOVER, texture_id));
else
return false;

View file

@ -644,8 +644,12 @@ bool GizmoObjectManipulation::reset_button(ImGuiWrapper *imgui_wrapper, float ca
ImTextureID normal_id = m_glcanvas.get_gizmos_manager().get_icon_texture_id(GLGizmosManager::MENU_ICON_NAME::IC_TOOLBAR_RESET);
ImTextureID hover_id = m_glcanvas.get_gizmos_manager().get_icon_texture_id(GLGizmosManager::MENU_ICON_NAME::IC_TOOLBAR_RESET_HOVER);
float font_size = ImGui::GetFontSize();
ImVec2 button_size = ImVec2(font_size, font_size);
float scale = m_glcanvas.get_scale();
#ifdef WIN32
int dpi = get_dpi_for_window(wxGetApp().GetTopWindow());
scale *= (float) dpi / (float) DPI_DEFAULT;
#endif // WIN32
ImVec2 button_size = ImVec2(16 * scale, 16 * scale); // ORCA: Use exact resolution will prevent blur on icon
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
@ -661,8 +665,12 @@ bool GizmoObjectManipulation::reset_zero_button(ImGuiWrapper *imgui_wrapper, flo
ImTextureID normal_id = m_glcanvas.get_gizmos_manager().get_icon_texture_id(GLGizmosManager::MENU_ICON_NAME::IC_TOOLBAR_RESET_ZERO);
ImTextureID hover_id = m_glcanvas.get_gizmos_manager().get_icon_texture_id(GLGizmosManager::MENU_ICON_NAME::IC_TOOLBAR_RESET_ZERO_HOVER);
float font_size = ImGui::GetFontSize() * 1.1;
ImVec2 button_size = ImVec2(font_size, font_size);
float scale = m_glcanvas.get_scale();
#ifdef WIN32
int dpi = get_dpi_for_window(wxGetApp().GetTopWindow());
scale *= (float) dpi / (float) DPI_DEFAULT;
#endif // WIN32
ImVec2 button_size = ImVec2(16 * scale, 16 * scale); // ORCA: Use exact resolution will prevent blur on icon
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
@ -719,6 +727,10 @@ void GizmoObjectManipulation::show_move_tooltip_information(ImGuiWrapper *imgui_
caption_max += imgui_wrapper->calc_text_size(": "sv).x + 35.f;
float scale = m_glcanvas.get_scale();
#ifdef WIN32
int dpi = get_dpi_for_window(wxGetApp().GetTopWindow());
scale *= (float) dpi / (float) DPI_DEFAULT;
#endif // WIN32
ImVec2 button_size = ImVec2(25 * scale, 25 * scale); // ORCA: Use exact resolution will prevent blur on icon
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {0, ImGui::GetStyle().FramePadding.y});
@ -747,6 +759,10 @@ void GizmoObjectManipulation::show_rotate_tooltip_information(ImGuiWrapper *imgu
caption_max += imgui_wrapper->calc_text_size(": "sv).x + 35.f;
float scale = m_glcanvas.get_scale();
#ifdef WIN32
int dpi = get_dpi_for_window(wxGetApp().GetTopWindow());
scale *= (float) dpi / (float) DPI_DEFAULT;
#endif // WIN32
ImVec2 button_size = ImVec2(25 * scale, 25 * scale); // ORCA: Use exact resolution will prevent blur on icon
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {0, ImGui::GetStyle().FramePadding.y});
@ -775,6 +791,10 @@ void GizmoObjectManipulation::show_scale_tooltip_information(ImGuiWrapper *imgui
caption_max += imgui_wrapper->calc_text_size(": "sv).x + 35.f;
float scale = m_glcanvas.get_scale();
#ifdef WIN32
int dpi = get_dpi_for_window(wxGetApp().GetTopWindow());
scale *= (float) dpi / (float) DPI_DEFAULT;
#endif // WIN32
ImVec2 button_size = ImVec2(25 * scale, 25 * scale); // ORCA: Use exact resolution will prevent blur on icon
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {0, ImGui::GetStyle().FramePadding.y});

View file

@ -181,6 +181,7 @@ const ImVec4 ImGuiWrapper::COL_WINDOW_BG_DARK = { 45 / 255.f, 45 / 255.f, 49
const ImVec4 ImGuiWrapper::COL_TOOLBAR_BG = { 250 / 255.f, 250 / 255.f, 250 / 255.f, 1.f }; // ORCA color matches with toolbar_background.png
const ImVec4 ImGuiWrapper::COL_TOOLBAR_BG_DARK = { 57 / 255.f, 60 / 255.f, 66 / 255.f, 1.f }; // ORCA color matches with toolbar_background_dark.png
const ImVec4 ImGuiWrapper::COL_ORCA = to_ImVec4(ColorRGBA::ORCA());
const ImVec4 ImGuiWrapper::COL_MODIFIED = { 253.f / 255.f, 111.f / 255.f, 40.f / 255.f, 1}; // ORCA same color with m_color_label_modified
int ImGuiWrapper::TOOLBAR_WINDOW_FLAGS = ImGuiWindowFlags_AlwaysAutoResize
| ImGuiWindowFlags_NoMove
@ -1111,11 +1112,12 @@ bool ImGuiWrapper::slider_float(const char* label, float* v, float v_min, float
const ImGuiStyle& style = ImGui::GetStyle();
if (show_edit_btn) {
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, { 1, style.ItemSpacing.y });
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0); // ORCA match edit button style
ImGui::SameLine();
std::wstring btn_name = ImGui::SliderFloatEditBtnIcon + boost::nowide::widen(str_label);
ImGui::PushStyleColor(ImGuiCol_Button, { 0.25f, 0.25f, 0.25f, 0.0f });
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0.5f, 0.5f, 0.5f, 1.0f });
ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0.5f, 0.5f, 0.5f, 1.0f });
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, {0, 0, 0, 0 }); // ORCA match edit button style
ImGui::PushStyleColor(ImGuiCol_ButtonActive, {0, 0, 0, 0 }); // ORCA match edit button style
if (ImGui::Button(into_u8(btn_name).c_str())) {
ImGui::SetKeyboardFocusHere(-1);
this->set_requires_extra_frame();
@ -1124,7 +1126,7 @@ bool ImGuiWrapper::slider_float(const char* label, float* v, float v_min, float
if (ImGui::IsItemHovered())
this->tooltip(into_u8(_L("Edit")).c_str(), max_tooltip_width);
ImGui::PopStyleVar();
ImGui::PopStyleVar(2); // ORCA
}
if (label_visible) {
@ -2685,18 +2687,22 @@ void ImGuiWrapper::pop_combo_style()
ImGui::PopStyleColor(7);
}
void ImGuiWrapper::push_radio_style()
void ImGuiWrapper::push_radio_style(const float scale)
{
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(1.5f, 1.5f) * scale); // ORCA ensure icon size stays consistent
if (m_is_dark_mode) {
ImGui::PushStyleColor(ImGuiCol_CheckMark, to_ImVec4(decode_color_to_float_array("#00675b"))); // ORCA use orca color for radio buttons
ImGui::PushStyleColor(ImGuiCol_CheckMark, to_ImVec4(decode_color_to_float_array("#009688"))); // ORCA use orca color for radio buttons
ImGui::PushStyleColor(ImGuiCol_Border , to_ImVec4(decode_color_to_float_array("#949494"))); // ORCA match border color
} else {
ImGui::PushStyleColor(ImGuiCol_CheckMark, to_ImVec4(decode_color_to_float_array("#009688"))); // ORCA use orca color for radio buttons
ImGui::PushStyleColor(ImGuiCol_Border , to_ImVec4(decode_color_to_float_array("#7C8282"))); // ORCA match border color
}
}
void ImGuiWrapper::pop_radio_style()
{
ImGui::PopStyleColor(1);
ImGui::PopStyleColor(2);
ImGui::PopStyleVar(1);
}
void ImGuiWrapper::init_font(bool compress)

View file

@ -347,6 +347,7 @@ public:
static const ImVec4 COL_SEPARATOR;
static const ImVec4 COL_SEPARATOR_DARK;
static const ImVec4 COL_ORCA;
static const ImVec4 COL_MODIFIED;
//BBS
static void on_change_color_mode(bool is_dark);
@ -364,7 +365,7 @@ public:
static void pop_button_disable_style();
static void push_combo_style(const float scale);
static void pop_combo_style();
static void push_radio_style();
static void push_radio_style(const float scale);
static void pop_radio_style();
//BBS

View file

@ -342,7 +342,7 @@ void FillBedJob::finalize(bool canceled, std::exception_ptr &eptr)
//model_object->ensure_on_bed();
//BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << ": model_object->ensure_on_bed()";
if (m_instances && wxGetApp().app_config->get("auto_arrange") == "true") {
if (m_instances) {// && wxGetApp().app_config->get("auto_arrange") == "true") {
m_plater->set_prepare_state(Job::PREPARE_STATE_MENU);
m_plater->arrange();
}

View file

@ -282,29 +282,10 @@ MultiMachineManagerPage::MultiMachineManagerPage(wxWindow* parent)
);
//edit prints
auto m_btn_bg_enable = StateColor(
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
StateColor clean_bg(std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Disabled), std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered), std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Enabled),
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal));
StateColor clean_bd(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
StateColor clean_text(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
auto sizer_button_printer = new wxBoxSizer(wxHORIZONTAL);
sizer_button_printer->SetMinSize(wxSize(FromDIP(DEVICE_ITEM_MAX_WIDTH), -1));
m_button_edit = new Button(m_main_panel, _L("Edit Printers"));
m_button_edit->SetBackgroundColor(clean_bg);
m_button_edit->SetBorderColor(clean_bd);
m_button_edit->SetTextColor(clean_text);
m_button_edit->SetFont(Label::Body_12);
m_button_edit->SetCornerRadius(6);
m_button_edit->SetMinSize(wxSize(FromDIP(90), FromDIP(36)));
m_button_edit->SetMaxSize(wxSize(FromDIP(90), FromDIP(36)));
m_button_edit->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_button_edit->Bind(wxEVT_BUTTON, [this](wxCommandEvent& evt) {
MultiMachinePickPage dlg;
@ -405,13 +386,7 @@ MultiMachineManagerPage::MultiMachineManagerPage(wxWindow* parent)
m_tip_text->Wrap(-1);
m_button_add = new Button(m_main_panel, _L("Add"));
m_button_add->SetBackgroundColor(m_btn_bg_enable);
m_button_add->SetBorderColor(m_btn_bg_enable);
m_button_add->SetTextColor(*wxWHITE);
m_button_add->SetFont(Label::Body_12);
m_button_add->SetCornerRadius(6);
m_button_add->SetMinSize(wxSize(FromDIP(90), FromDIP(36)));
m_button_add->SetMaxSize(wxSize(FromDIP(90), FromDIP(36)));
m_button_add->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_button_add->Bind(wxEVT_BUTTON, [this](wxCommandEvent& evt) {
MultiMachinePickPage dlg;

View file

@ -4,6 +4,7 @@
#include "Jobs/BoostThreadWorker.hpp"
#include "Jobs/PlaterWorker.hpp"
#include "wxExtensions.hpp"
#include "Widgets/DialogButtons.hpp"
namespace Slic3r {
namespace GUI {
@ -20,10 +21,8 @@ OAuthDialog::OAuthDialog(wxWindow* parent, OAuthParams params)
m_worker = std::make_unique<PlaterWorker<BoostThreadWorker>>(this, nullptr, "auth_worker");
wxStdDialogButtonSizer* btns = this->CreateStdDialogButtonSizer(wxCANCEL);
btnCancel = static_cast<wxButton*>(this->FindWindowById(wxID_CANCEL, this));
wxGetApp().UpdateDarkUI(btnCancel);
btnCancel->Bind(wxEVT_BUTTON, &OAuthDialog::on_cancel, this);
auto dlg_btns = new DialogButtons(this, {"Cancel"});
dlg_btns->GetCANCEL()->Bind(wxEVT_BUTTON, &OAuthDialog::on_cancel, this);
const auto message_sizer = new wxBoxSizer(wxVERTICAL);
const auto message = new wxStaticText(this, wxID_ANY, _L("Authorizing..."), wxDefaultPosition, wxDefaultSize, 0);
@ -32,7 +31,7 @@ OAuthDialog::OAuthDialog(wxWindow* parent, OAuthParams params)
const auto topSizer = new wxBoxSizer(wxVERTICAL);
topSizer->Add(message_sizer, 0, wxEXPAND | wxALL, BORDER_W);
topSizer->Add(btns, 0, wxEXPAND | wxALL, BORDER_W);
topSizer->Add(dlg_btns, 0, wxEXPAND);
Bind(wxEVT_CLOSE_WINDOW, &OAuthDialog::on_cancel, this);

View file

@ -14,7 +14,6 @@ private:
OAuthParams _params;
std::shared_ptr<OAuthResult> _result;
wxButton* btnCancel{nullptr};
std::unique_ptr<Worker> m_worker;
void on_cancel(wxEvent& event);

View file

@ -12,6 +12,7 @@
#include "libslic3r/Config.hpp"
#include "BitmapComboBox.hpp"
#include "Widgets/ComboBox.hpp"
#include "Widgets/DialogButtons.hpp"
#include <wx/sizer.h>
#include "libslic3r/ObjColorUtils.hpp"
@ -40,12 +41,7 @@ static void update_ui(wxWindow* window)
static const char g_min_cluster_color = 1;
static const char g_max_color = (int) EnforcerBlockerType::ExtruderMax;
const StateColor ok_btn_bg(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
const StateColor ok_btn_disable_bg(std::pair<wxColour, int>(wxColour(205, 201, 201), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(205, 201, 201), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(205, 201, 201), StateColor::Normal));
wxBoxSizer* ObjColorDialog::create_btn_sizer(long flags,bool exist_error)
{
auto btn_sizer = new wxBoxSizer(wxHORIZONTAL);
@ -58,7 +54,7 @@ wxBoxSizer* ObjColorDialog::create_btn_sizer(long flags,bool exist_error)
auto font = tips->GetFont();
font.SetUnderlined(true);
tips->SetFont(font);
tips->SetForegroundColour(wxColour(0, 174, 100));
tips->SetForegroundColour(wxColour("#009687"));
tips->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
bool is_zh = wxGetApp().app_config->get("language") == "zh_CN";
if (is_zh) {
@ -71,79 +67,16 @@ wxBoxSizer* ObjColorDialog::create_btn_sizer(long flags,bool exist_error)
}
btn_sizer->AddStretchSpacer();
StateColor ok_btn_bd(
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
StateColor ok_btn_text(
std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Normal)
);
StateColor cancel_btn_bg(
std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal)
);
StateColor cancel_btn_bd_(
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Normal)
);
StateColor cancel_btn_text(
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Normal)
);
StateColor calc_btn_bg(
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
StateColor calc_btn_bd(
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
StateColor calc_btn_text(
std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Normal)
);
if (flags & wxOK) {
Button* ok_btn = new Button(this, _L("OK"));
ok_btn->SetMinSize(BTN_SIZE);
ok_btn->SetCornerRadius(FromDIP(12));
ok_btn->Enable(false);
ok_btn->SetBackgroundColor(ok_btn_disable_bg);
ok_btn->SetBorderColor(ok_btn_bd);
ok_btn->SetTextColor(ok_btn_text);
ok_btn->SetFocus();
ok_btn->SetId(wxID_OK);
btn_sizer->Add(ok_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, BTN_GAP);
m_button_list[wxOK] = ok_btn;
}
if (flags & wxCANCEL) {
Button* cancel_btn = new Button(this, _L("Cancel"));
cancel_btn->SetMinSize(BTN_SIZE);
cancel_btn->SetCornerRadius(FromDIP(12));
cancel_btn->SetBackgroundColor(cancel_btn_bg);
cancel_btn->SetBorderColor(cancel_btn_bd_);
cancel_btn->SetTextColor(cancel_btn_text);
cancel_btn->SetId(wxID_CANCEL);
btn_sizer->Add(cancel_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, BTN_GAP);
m_button_list[wxCANCEL] = cancel_btn;
}
auto dlg_btns = new DialogButtons(this, {"OK", "Cancel"});
m_button_list[wxOK] = dlg_btns->GetOK();
m_button_list[wxCANCEL] = dlg_btns->GetCANCEL();
btn_sizer->Add(dlg_btns, 0, wxEXPAND | wxALIGN_CENTER_VERTICAL);
return btn_sizer;
}
void ObjColorDialog::on_dpi_changed(const wxRect &suggested_rect)
{
for (auto button_item : m_button_list)
{
if (button_item.first == wxRESET)
{
button_item.second->SetMinSize(wxSize(FromDIP(75), FromDIP(24)));
button_item.second->SetCornerRadius(FromDIP(12));
}
if (button_item.first == wxOK) {
button_item.second->SetMinSize(BTN_SIZE);
button_item.second->SetCornerRadius(FromDIP(12));
}
if (button_item.first == wxCANCEL) {
button_item.second->SetMinSize(BTN_SIZE);
button_item.second->SetCornerRadius(FromDIP(12));
}
}
m_panel_ObjColor->msw_rescale();
this->Refresh();
}
@ -215,12 +148,12 @@ ObjColorDialog::ObjColorDialog(wxWindow *parent, Slic3r::ObjDialogInOut &in_out,
if (!ok) {
m_button_list[wxCANCEL]->Hide();
m_button_list[wxOK]->Enable(true);
m_button_list[wxOK]->SetBackgroundColor(ok_btn_bg);
// ORCA no need to set colors again
} else {
m_button_list[wxOK]->Bind(wxEVT_UPDATE_UI, ([this](wxUpdateUIEvent &e) {
if (m_panel_ObjColor->is_ok() == m_button_list[wxOK]->IsEnabled()) { return; }
m_button_list[wxOK]->Enable(m_panel_ObjColor->is_ok());
m_button_list[wxOK]->SetBackgroundColor(m_panel_ObjColor->is_ok() ? ok_btn_bg : ok_btn_disable_bg);
// ORCA no need to set colors again
}));
}
m_main_sizer->Add(m_buttons_sizer, 0, wxBOTTOM | wxTOP | wxRIGHT | wxEXPAND, BTN_GAP);
@ -556,23 +489,12 @@ void ObjColorPanel::do_layout_callback() {
wxBoxSizer *ObjColorPanel::create_approximate_match_btn_sizer(wxWindow *parent)
{
auto btn_sizer = new wxBoxSizer(wxHORIZONTAL);
StateColor calc_btn_bg(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor calc_btn_bd(std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor calc_btn_text(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Normal));
//create btn
m_quick_approximate_match_btn = new Button(parent, _L("Color match"));
m_quick_approximate_match_btn->SetToolTip(_L("Approximate color matching."));
auto cur_btn = m_quick_approximate_match_btn;
cur_btn->SetFont(Label::Body_13);
cur_btn->SetMinSize(wxSize(FromDIP(60), FromDIP(20)));
cur_btn->SetCornerRadius(FromDIP(10));
cur_btn->SetBackgroundColor(calc_btn_bg);
cur_btn->SetBorderColor(calc_btn_bd);
cur_btn->SetTextColor(calc_btn_text);
cur_btn->SetFocus();
btn_sizer->Add(cur_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 0);
cur_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &) {
m_quick_approximate_match_btn->SetStyle(ButtonStyle::Regular, ButtonType::Window);
m_quick_approximate_match_btn->SetFocus();
btn_sizer->Add(m_quick_approximate_match_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 0);
m_quick_approximate_match_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &) {
deal_approximate_match_btn();
deal_thumbnail();
});
@ -582,20 +504,10 @@ wxBoxSizer *ObjColorPanel::create_approximate_match_btn_sizer(wxWindow *parent)
wxBoxSizer *ObjColorPanel::create_add_btn_sizer(wxWindow *parent)
{
auto btn_sizer = new wxBoxSizer(wxHORIZONTAL);
StateColor calc_btn_bg(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor calc_btn_bd(std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor calc_btn_text(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Normal));
// create btn
m_quick_add_btn = new Button(parent, _L("Append"));
m_quick_add_btn->SetToolTip(_L("Append to existing filaments"));
auto cur_btn = m_quick_add_btn;
cur_btn->SetFont(Label::Body_13);
cur_btn->SetMinSize(wxSize(FromDIP(60), FromDIP(20)));
cur_btn->SetCornerRadius(FromDIP(10));
cur_btn->SetBackgroundColor(calc_btn_bg);
cur_btn->SetBorderColor(calc_btn_bd);
cur_btn->SetTextColor(calc_btn_text);
cur_btn->SetStyle(ButtonStyle::Regular, ButtonType::Window);
cur_btn->SetFocus();
btn_sizer->Add(cur_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 0);
cur_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &) {
@ -608,20 +520,10 @@ wxBoxSizer *ObjColorPanel::create_add_btn_sizer(wxWindow *parent)
wxBoxSizer *ObjColorPanel::create_reset_btn_sizer(wxWindow *parent)
{
auto btn_sizer = new wxBoxSizer(wxHORIZONTAL);
StateColor calc_btn_bg(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor calc_btn_bd(std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor calc_btn_text(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Normal));
// create btn
m_quick_reset_btn = new Button(parent, _L("Reset"));
m_quick_reset_btn->SetToolTip(_L("Reset mapped extruders."));
auto cur_btn = m_quick_reset_btn;
cur_btn->SetFont(Label::Body_13);
cur_btn->SetMinSize(wxSize(FromDIP(60), FromDIP(20)));
cur_btn->SetCornerRadius(FromDIP(10));
cur_btn->SetBackgroundColor(calc_btn_bg);
cur_btn->SetBorderColor(calc_btn_bd);
cur_btn->SetTextColor(calc_btn_text);
cur_btn->SetStyle(ButtonStyle::Regular, ButtonType::Window);
cur_btn->SetFocus();
btn_sizer->Add(cur_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 0);
cur_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &) {

View file

@ -213,7 +213,7 @@ void ObjectDataViewModelNode::set_variable_height_icon(VaryHeightIndicator vari_
if (m_variable_height == vari_height)
return;
m_variable_height = vari_height;
m_variable_height_icon = m_variable_height == hiUnVariable ? m_empty_bmp : create_scaled_bitmap("toolbar_variable_layer_height", nullptr, 20);
m_variable_height_icon = m_variable_height == hiUnVariable ? m_empty_bmp : create_scaled_bitmap("obj_variable_layer_height");
}
void ObjectDataViewModelNode::set_action_icon(bool enable)
@ -311,9 +311,9 @@ void ObjectDataViewModelNode::msw_rescale()
m_action_icon = create_scaled_bitmap(m_action_icon_name);
if (m_printable != piUndef)
m_printable_icon = create_scaled_bitmap(m_printable == piPrintable ? "obj_printable" : "obj_unprintable");
m_printable_icon = create_scaled_bitmap(m_printable == piPrintable ? "check_on" : "check_off_focused");
m_variable_height_icon = m_variable_height == hiUnVariable ? m_empty_bmp : create_scaled_bitmap("toolbar_variable_layer_height", nullptr, 20);
m_variable_height_icon = m_variable_height == hiUnVariable ? m_empty_bmp : create_scaled_bitmap("obj_variable_layer_height");
if (!m_opt_categories.empty())
update_settings_digest_bitmaps();

View file

@ -129,42 +129,16 @@ wxBoxSizer *TipsDialog::create_item_checkbox(wxString title, wxWindow *parent, w
Button *TipsDialog::add_button(wxWindowID btn_id, const wxString &label, bool set_focus /*= false*/)
{
Button* btn = new Button(this, label, "", 0, 0, btn_id);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor btn_bd_green(std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
if (btn_id == wxID_OK || btn_id == wxID_YES)
btn->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
StateColor btn_text_green(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Normal));
StateColor btn_bg_white(
std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal)
);
StateColor btn_bd_white(std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Normal));
StateColor btn_text_white(std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Normal));
if (btn_id == wxID_OK || btn_id == wxID_YES) {
btn->SetBackgroundColor(btn_bg_green);
btn->SetBorderColor(btn_bd_green);
btn->SetTextColor(btn_text_green);
}
if (btn_id == wxID_CANCEL || btn_id == wxID_NO) {
btn->SetBackgroundColor(btn_bg_white);
btn->SetBorderColor(btn_bd_white);
btn->SetTextColor(btn_text_white);
}
if (btn_id == wxID_CANCEL || btn_id == wxID_NO)
btn->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
if (set_focus)
btn->SetFocus();
btn->SetSize(TIPS_DIALOG_BUTTON_SIZE);
btn->SetMinSize(TIPS_DIALOG_BUTTON_SIZE);
btn->SetCornerRadius(FromDIP(12));
btn->Bind(wxEVT_BUTTON, [this, btn_id](wxCommandEvent &) {
if (m_show_again) {
if (!m_app_key.empty()) {
@ -184,8 +158,7 @@ Button *TipsDialog::add_button(wxWindowID btn_id, const wxString &label, bool se
void TipsDialog::on_dpi_changed(const wxRect &suggested_rect)
{
if (m_confirm) m_confirm->SetMinSize(TIPS_DIALOG_BUTTON_SIZE);
if (m_cancel) m_cancel->SetMinSize(TIPS_DIALOG_BUTTON_SIZE);
if (m_confirm) m_confirm->Rescale(); // ORCA
Fit();
Refresh();
}
@ -286,8 +259,16 @@ ParamsPanel::ParamsPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, c
m_tips_arrow = new ScalableButton(m_top_panel, wxID_ANY, "tips_arrow");
m_tips_arrow->Hide();
m_title_view = new Label(m_top_panel, Label::Body_12, _L("Advance")); // ORCA match size with advanced toggle on tab.cpp m_static_title
m_mode_icon = new ScalableButton(m_top_panel, wxID_ANY, "advanced"); // ORCA
m_mode_icon->Bind(wxEVT_BUTTON, [this](wxCommandEvent e) {
m_mode_view->SetValue(!m_mode_view->GetValue());
wxCommandEvent evt(wxEVT_TOGGLEBUTTON, m_mode_view->GetId()); // ParamsPanel::OnToggled(evt)
evt.SetEventObject(m_mode_view);
m_mode_view->wxEvtHandler::ProcessEvent(evt);
});
m_mode_icon->SetToolTip(_L("Show/Hide advanced parameters"));
m_mode_view = new SwitchButton(m_top_panel, wxID_ABOUT);
m_mode_view->SetToolTip(_L("Show/Hide advanced parameters"));
// BBS: new layout
//m_search_btn = new ScalableButton(m_top_panel, wxID_ANY, "search", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true);
@ -421,23 +402,16 @@ void ParamsPanel::create_layout()
if (m_top_panel) {
m_mode_sizer = new wxBoxSizer( wxHORIZONTAL );
m_mode_sizer->AddSpacer(FromDIP(SidebarProps::TitlebarMargin()));
m_mode_sizer->Add(m_process_icon, 0, wxALIGN_CENTER);
m_mode_sizer->AddSpacer(FromDIP(SidebarProps::ElementSpacing()));
m_mode_sizer->Add( m_title_label, 0, wxALIGN_CENTER );
m_mode_sizer->AddStretchSpacer(2);
m_mode_sizer->Add(m_mode_region, 0, wxALIGN_CENTER);
m_mode_sizer->AddSpacer(FromDIP(SidebarProps::ElementSpacing()));
m_mode_sizer->Add(m_tips_arrow, 0, wxALIGN_CENTER);
m_mode_sizer->AddStretchSpacer(12);
m_mode_sizer->Add( m_title_view, 0, wxALIGN_CENTER );
m_mode_sizer->AddSpacer(FromDIP(SidebarProps::ElementSpacing()));
m_mode_sizer->Add(m_mode_view, 0, wxALIGN_CENTER);
m_mode_sizer->AddSpacer(FromDIP(SidebarProps::ElementSpacing() * 6)); // ORCA using spacer prevents shaky mode_view when tips_arrow highlighting mode_region instead using AddStretchSpacer
m_mode_sizer->Add(m_setting_btn, 0, wxALIGN_CENTER);
m_mode_sizer->AddSpacer(FromDIP(SidebarProps::IconSpacing()));
m_mode_sizer->Add(m_compare_btn, 0, wxALIGN_CENTER);
m_mode_sizer->AddSpacer(FromDIP(SidebarProps::TitlebarMargin()));
m_mode_sizer->Add(m_process_icon, 0, wxALIGN_CENTER | wxLEFT , FromDIP(SidebarProps::TitlebarMargin()));
m_mode_sizer->Add(m_title_label , 0, wxALIGN_CENTER | wxLEFT , FromDIP(SidebarProps::ElementSpacing()));
m_mode_sizer->Add(m_mode_region , 0, wxALIGN_CENTER | wxLEFT , FromDIP(SidebarProps::WideSpacing()));
m_mode_sizer->Add(m_tips_arrow , 0, wxALIGN_CENTER | wxLEFT , FromDIP(SidebarProps::ElementSpacing()));
m_mode_sizer->AddSpacer(FromDIP(SidebarProps::IconSpacing())); // ensure there is spacing after control when sidebar has less width
m_mode_sizer->AddStretchSpacer();
m_mode_sizer->Add(m_mode_icon , 0, wxALIGN_CENTER | wxRIGHT, FromDIP(SidebarProps::ElementSpacing()));
m_mode_sizer->Add(m_mode_view , 0, wxALIGN_CENTER | wxRIGHT, FromDIP(SidebarProps::WideSpacing()));
m_mode_sizer->Add(m_setting_btn , 0, wxALIGN_CENTER | wxRIGHT, FromDIP(SidebarProps::WideSpacing()));
m_mode_sizer->Add(m_compare_btn , 0, wxALIGN_CENTER | wxRIGHT, FromDIP(SidebarProps::TitlebarMargin()));
//m_mode_sizer->Add( m_search_btn, 0, wxALIGN_CENTER );
//m_mode_sizer->AddSpacer(16);
m_mode_sizer->SetMinSize(-1, FromDIP(30));
@ -717,6 +691,7 @@ void ParamsPanel::msw_rescale()
m_mode_sizer->SetMinSize(-1, 3 * em_unit(this));
if (m_mode_region)
((SwitchButton* )m_mode_region)->Rescale();
if (m_mode_icon) m_mode_icon->msw_rescale();
if (m_mode_view)
((SwitchButton* )m_mode_view)->Rescale();
for (auto tab : {m_tab_print, m_tab_print_plate, m_tab_print_object, m_tab_print_part, m_tab_print_layer, m_tab_filament, m_tab_printer}) {
@ -818,10 +793,10 @@ void ParamsPanel::delete_subwindows()
m_mode_view = nullptr;
}
if (m_title_view)
if (m_mode_icon) // ORCA m_title_view replacement
{
delete m_title_view;
m_title_view = nullptr;
delete m_mode_icon;
m_mode_icon = nullptr;
}
if (m_search_btn)

View file

@ -34,8 +34,6 @@
class SwitchButton;
class StaticBox;
#define TIPS_DIALOG_BUTTON_SIZE wxSize(FromDIP(60), FromDIP(24))
namespace Slic3r {
namespace GUI {
@ -86,7 +84,7 @@ class ParamsPanel : public wxPanel
SwitchButton* m_mode_region { nullptr };
ScalableButton *m_tips_arrow{nullptr};
bool m_tips_arror_blink{false};
wxStaticText* m_title_view { nullptr };
ScalableButton* m_mode_icon { nullptr }; // ORCA
SwitchButton* m_mode_view { nullptr };
//wxBitmapButton* m_search_button { nullptr };
wxStaticLine* m_staticline_print { nullptr };

View file

@ -5,6 +5,7 @@
#include <cstddef>
#include <algorithm>
#include <numeric>
#include <limits>
#include <vector>
#include <string>
#include <regex>
@ -936,7 +937,7 @@ public:
Bind(wxEVT_PAINT, [this](wxPaintEvent& evt) {
wxPaintDC dc(this);
dc.SetPen(wxColour("#EEEEEE"));
dc.SetPen(StateColor::darkModeColorFor(wxColour("#DBDBDB"))); // ORCA match popup border color
dc.SetBrush(*wxTRANSPARENT_BRUSH);
dc.DrawRoundedRectangle(0, 0, GetSize().x, GetSize().y, 0);
});
@ -1636,8 +1637,8 @@ Sidebar::Sidebar(Plater *parent)
h_sizer_title->AddSpacer(FromDIP(SidebarProps::ElementSpacing()));
h_sizer_title->Add(p->m_text_printer_settings, 0, wxALIGN_CENTER);
h_sizer_title->AddStretchSpacer();
h_sizer_title->Add(p->m_printer_connect , 0, wxALIGN_CENTER | wxRIGHT, FromDIP(20)); // used larger margin to prevent accidental clicks
h_sizer_title->Add(p->m_printer_bbl_sync, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(20)); // used larger margin to prevent accidental clicks
h_sizer_title->Add(p->m_printer_connect , 0, wxALIGN_CENTER | wxRIGHT, FromDIP(SidebarProps::WideSpacing())); // used larger margin to prevent accidental clicks
h_sizer_title->Add(p->m_printer_bbl_sync, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(SidebarProps::WideSpacing())); // used larger margin to prevent accidental clicks
h_sizer_title->Add(p->m_printer_setting, 0, wxALIGN_CENTER);
h_sizer_title->AddSpacer(FromDIP(SidebarProps::TitlebarMargin()));
h_sizer_title->SetMinSize(-1, 3 * em);
@ -1654,10 +1655,7 @@ Sidebar::Sidebar(Plater *parent)
// add printer title
scrolled_sizer->Add(p->m_panel_printer_title, 0, wxEXPAND | wxALL, 0);
p->m_panel_printer_title->Bind(wxEVT_LEFT_UP, [this] (auto & e) {
if (p->m_panel_printer_content->GetMaxHeight() == 0)
p->m_panel_printer_content->SetMaxSize({-1, -1});
else
p->m_panel_printer_content->SetMaxSize({-1, 0});
p->m_panel_printer_content->Show(!p->m_panel_printer_content->IsShown());
m_scrolled_sizer->Layout();
});
@ -1987,16 +1985,7 @@ Sidebar::Sidebar(Plater *parent)
if (e.GetPosition().x > (p->m_flushing_volume_btn->IsShown()
? p->m_flushing_volume_btn->GetPosition().x : (p->m_bpButton_add_filament->GetPosition().x - FromDIP(30)))) // ORCA exclude area of del button from titlebar collapse/expand feature to fix undesired collapse when user spams del filament button
return;
if (p->m_panel_filament_content->GetMaxHeight() == 0) {
p->m_panel_filament_content->SetMaxSize({-1, FromDIP(174)});
auto min_size = p->m_panel_filament_content->GetSizer()->GetMinSize();
if (min_size.y > p->m_panel_filament_content->GetMaxHeight())
min_size.y = p->m_panel_filament_content->GetMaxHeight();
p->m_panel_filament_content->SetMinSize({-1, min_size.y});
} else {
p->m_panel_filament_content->SetMinSize({-1, 0});
p->m_panel_filament_content->SetMaxSize({-1, 0});
}
p->m_panel_filament_content->Show(!p->m_panel_filament_content->IsShown());
m_scrolled_sizer->Layout();
});
@ -2038,7 +2027,7 @@ Sidebar::Sidebar(Plater *parent)
}));
bSizer39->Add(p->m_flushing_volume_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(4));
bSizer39->Hide(p->m_flushing_volume_btn);
bSizer39->Hide(p->m_flushing_volume_btn); // ORCA Ensure button is hidden on launch while 1 filament exist
ScalableButton* add_btn = new ScalableButton(p->m_panel_filament_title, wxID_ANY, "add_filament");
add_btn->SetToolTip(_L("Add one filament"));
@ -2058,12 +2047,8 @@ Sidebar::Sidebar(Plater *parent)
bSizer39->Add(del_btn, 0, wxALIGN_CENTER | wxLEFT, FromDIP(SidebarProps::IconSpacing()));
bSizer39->Add(add_btn, 0, wxALIGN_CENTER | wxLEFT, FromDIP(SidebarProps::IconSpacing())); // ORCA Moved add button after delete button to prevent add button position change when remove icon automatically hidden
bSizer39->AddSpacer(FromDIP(20));
if (p->combos_filament.size() <= 1) { // ORCA Fix Flushing button and Delete filament button not hidden on launch while only 1 filament exist
bSizer39->Hide(p->m_flushing_volume_btn);
//bSizer39->Hide(p->m_bpButton_del_filament); // ORCA: Hide delete filament button if there is only one filament
}
bSizer39->Hide(p->m_bpButton_del_filament); // ORCA Ensure button is hidden on launch while 1 filament exist
ams_btn = new ScalableButton(p->m_panel_filament_title, wxID_ANY, "ams_fila_sync", wxEmptyString, wxDefaultSize, wxDefaultPosition,
wxBU_EXACTFIT | wxNO_BORDER, false, 16); // ORCA match icon size with other icons as 16x16
@ -2075,7 +2060,7 @@ Sidebar::Sidebar(Plater *parent)
ams_btn->Bind(wxEVT_UPDATE_UI, &Sidebar::update_sync_ams_btn_enable, this);
p->m_bpButton_ams_filament = ams_btn;
bSizer39->Add(ams_btn, 0, wxALIGN_CENTER | wxLEFT, FromDIP(SidebarProps::IconSpacing()));
bSizer39->Add(ams_btn, 0, wxALIGN_CENTER | wxLEFT, FromDIP(SidebarProps::WideSpacing()));
//bSizer39->Add(FromDIP(10), 0, 0, 0, 0 );
ScalableButton* set_btn = new ScalableButton(p->m_panel_filament_title, wxID_ANY, "settings");
@ -2088,7 +2073,7 @@ Sidebar::Sidebar(Plater *parent)
});
p->m_bpButton_set_filament = set_btn;
bSizer39->Add(set_btn, 0, wxALIGN_CENTER | wxLEFT, FromDIP(SidebarProps::IconSpacing()));
bSizer39->Add(set_btn, 0, wxALIGN_CENTER | wxLEFT, FromDIP(SidebarProps::WideSpacing()));
bSizer39->AddSpacer(FromDIP(SidebarProps::TitlebarMargin()));
// add filament content
@ -4120,6 +4105,8 @@ struct Plater::priv
bool m_ignore_event{false};
bool m_slice_all{false};
bool m_is_slicing {false};
bool auto_reslice_pending {false};
bool auto_reslice_after_cancel {false};
bool m_is_publishing {false};
int m_is_RightClickInLeftUI{-1};
int m_cur_slice_plate;
@ -4164,6 +4151,7 @@ struct Plater::priv
std::string delayed_error_message;
wxTimer background_process_timer;
wxTimer auto_reslice_timer;
std::string label_btn_export;
std::string label_btn_send;
@ -4373,6 +4361,9 @@ struct Plater::priv
std::vector<std::vector<DynamicPrintConfig>> get_extruder_filament_info();
void update_print_volume_state();
void schedule_background_process();
void schedule_auto_reslice_if_needed();
void trigger_auto_reslice_now();
int auto_slice_delay_seconds() const;
// Update background processing thread from the current config and Model.
enum UpdateBackgroundProcessReturnState {
// update_background_process() reports, that the Print / SLAPrint was updated in a way,
@ -4758,10 +4749,18 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
panels.push_back(assemble_view);
this->background_process_timer.SetOwner(this->q, 0);
this->auto_reslice_timer.SetOwner(this->q, 0);
this->q->Bind(wxEVT_TIMER, [this](wxTimerEvent &evt)
{
if (!this->suppressed_backround_processing_update)
this->update_restart_background_process(false, false);
if (&evt.GetTimer() == &this->background_process_timer) {
if (!this->suppressed_backround_processing_update)
this->update_restart_background_process(false, false);
} else if (&evt.GetTimer() == &this->auto_reslice_timer) {
this->auto_reslice_timer.Stop();
this->trigger_auto_reslice_now();
} else {
evt.Skip();
}
});
update();
@ -7301,6 +7300,90 @@ void Plater::priv::schedule_background_process()
this->view3D->get_canvas3d()->set_config(this->config);
}
void Plater::priv::schedule_auto_reslice_if_needed()
{
AppConfig* cfg = wxGetApp().app_config;
if (cfg == nullptr || !cfg->get_bool("auto_slice_after_change"))
return;
if (model.objects.empty())
return;
PartPlate* plate = partplate_list.get_curr_plate();
if (plate == nullptr || !plate->has_printable_instances())
return;
if (background_process.running() || m_is_slicing) {
// Remember to restart once the current slice stops and cancel it now.
auto_reslice_after_cancel = true;
background_process.stop();
return;
}
const int delay_seconds = auto_slice_delay_seconds();
if (delay_seconds > 0) {
auto_reslice_pending = true;
auto_reslice_timer.Stop();
auto_reslice_timer.Start(delay_seconds * 1000, wxTIMER_ONE_SHOT);
return;
}
if (auto_reslice_pending)
return;
auto_reslice_pending = true;
auto_reslice_timer.Stop();
wxGetApp().CallAfter([this]() { this->trigger_auto_reslice_now(); });
}
void Plater::priv::trigger_auto_reslice_now()
{
this->auto_reslice_pending = false;
AppConfig* cfg = wxGetApp().app_config;
if (cfg == nullptr || !cfg->get_bool("auto_slice_after_change"))
return;
if (this->model.objects.empty())
return;
if (this->background_process.running() || this->m_is_slicing)
return;
PartPlate* plate = this->partplate_list.get_curr_plate();
if (plate == nullptr || !plate->has_printable_instances())
return;
this->q->reslice();
}
int Plater::priv::auto_slice_delay_seconds() const
{
AppConfig* cfg = wxGetApp().app_config;
if (cfg == nullptr)
return 0;
std::string delay_str = cfg->get("auto_slice_change_delay_seconds");
if (delay_str.empty())
return 0;
long delay_seconds = 0;
try {
delay_seconds = std::stol(delay_str);
} catch (...) {
delay_seconds = 0;
}
if (delay_seconds < 0)
delay_seconds = 0;
const long max_seconds = std::numeric_limits<int>::max() / 1000;
if (delay_seconds > max_seconds)
delay_seconds = max_seconds;
return static_cast<int>(delay_seconds);
}
std::vector<std::vector<DynamicPrintConfig>> Plater::priv::get_extruder_filament_info()
{
std::vector<std::vector<DynamicPrintConfig>> filament_infos;
@ -9462,6 +9545,11 @@ void Plater::priv::on_process_completed(SlicingProcessCompletedEvent &evt)
}
}
}
if (auto_reslice_after_cancel) {
auto_reslice_after_cancel = false;
schedule_auto_reslice_if_needed();
}
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(", exit.");
}
@ -14014,10 +14102,10 @@ void Plater::increase_instances(size_t num)
p->selection_changed();
this->p->schedule_background_process();
if (wxGetApp().app_config->get("auto_arrange") == "true") {
this->set_prepare_state(Job::PREPARE_STATE_MENU);
this->arrange();
}
//if (wxGetApp().app_config->get("auto_arrange") == "true") {
// this->set_prepare_state(Job::PREPARE_STATE_MENU);
// this->arrange();
//}
}
void Plater::decrease_instances(size_t num)
@ -14045,10 +14133,10 @@ void Plater::decrease_instances(size_t num)
p->selection_changed();
this->p->schedule_background_process();
if (wxGetApp().app_config->get("auto_arrange") == "true") {
this->set_prepare_state(Job::PREPARE_STATE_MENU);
this->arrange();
}
//if (wxGetApp().app_config->get("auto_arrange") == "true") {
// this->set_prepare_state(Job::PREPARE_STATE_MENU);
// this->arrange();
//}
}
static long GetNumberFromUser( const wxString& msg,
@ -15958,6 +16046,7 @@ void Plater::on_config_change(const DynamicPrintConfig &config)
if (p->main_frame->is_loaded()) {
this->p->schedule_background_process();
update_title_dirty_status();
p->schedule_auto_reslice_if_needed();
}
}

View file

@ -121,7 +121,8 @@ public:
static int TitlebarMargin(){ return 8 ;} // Use as side margins on titlebar. Has less margin on sides to create separation with its content
static int ContentMargin() { return 12;} // Use as side margins contents of title
static int ContentMarginV(){ return 9 ;} // Use as vertical margins contents of title
static int IconSpacing() { return 10;} // Use on main elements
static int IconSpacing() { return 10;} // Use on main elements in same group of controls
static int WideSpacing() { return 18;} // Use between main elements / control groups for separation or preventing accidental clicks important
static int ElementSpacing(){ return 5 ;} // Use if elements has relation between them like edit button for combo box etc.
};

View file

@ -679,6 +679,74 @@ wxBoxSizer *PreferencesDialog::create_item_backup(wxString title, wxString toolt
return m_sizer_input;
}
wxBoxSizer *PreferencesDialog::create_item_auto_reslice(wxString title, wxString checkbox_tooltip, wxString delay_tooltip)
{
wxBoxSizer *sizer_row = new wxBoxSizer(wxHORIZONTAL);
sizer_row->AddSpacer(FromDIP(DESIGN_LEFT_MARGIN));
auto checkbox_title = new wxStaticText(m_parent, wxID_ANY, title, wxDefaultPosition, DESIGN_TITLE_SIZE, wxST_NO_AUTORESIZE);
checkbox_title->SetForegroundColour(DESIGN_GRAY900_COLOR);
checkbox_title->SetFont(::Label::Body_14);
checkbox_title->Wrap(DESIGN_TITLE_SIZE.x);
checkbox_title->SetToolTip(checkbox_tooltip);
auto checkbox = new ::CheckBox(m_parent);
checkbox->SetValue(app_config->get_bool("auto_slice_after_change"));
checkbox->SetToolTip(checkbox_tooltip);
wxString delay_value = app_config->get("auto_slice_change_delay_seconds");
if (delay_value.empty())
delay_value = "0";
auto input = new ::TextInput(m_parent, wxEmptyString, _L("sec"), wxEmptyString, wxDefaultPosition, wxSize(FromDIP(97), -1), wxTE_PROCESS_ENTER);
StateColor input_bg(std::pair<wxColour, int>(wxColour("#F0F0F1"), StateColor::Disabled), std::pair<wxColour, int>(*wxWHITE, StateColor::Enabled));
input->SetBackgroundColor(input_bg);
input->GetTextCtrl()->SetValue(delay_value);
wxTextValidator validator(wxFILTER_DIGITS);
input->SetToolTip(delay_tooltip);
input->GetTextCtrl()->SetValidator(validator);
sizer_row->Add(checkbox_title, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, FromDIP(3));
sizer_row->Add(checkbox, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, FromDIP(5));
sizer_row->Add(input, 0, wxALIGN_CENTER_VERTICAL);
auto commit_delay = [this, input]() {
wxString value = input->GetTextCtrl()->GetValue();
long seconds = 0;
if (!value.ToLong(&seconds) || seconds < 0)
seconds = 0;
wxString sanitized = wxString::Format("%ld", seconds);
input->GetTextCtrl()->SetValue(sanitized);
app_config->set("auto_slice_change_delay_seconds", std::string(sanitized.mb_str()));
app_config->save();
};
input->GetTextCtrl()->Bind(wxEVT_TEXT_ENTER, [commit_delay](wxCommandEvent &e) {
commit_delay();
e.Skip();
});
input->GetTextCtrl()->Bind(wxEVT_KILL_FOCUS, [commit_delay](wxFocusEvent &e) {
commit_delay();
e.Skip();
});
checkbox->Bind(wxEVT_TOGGLEBUTTON, [this, checkbox, input](wxCommandEvent &e) {
const bool enabled = checkbox->GetValue();
app_config->set_bool("auto_slice_after_change", enabled);
app_config->save();
input->Enable(enabled);
input->Refresh();
e.Skip();
});
input->Enable(checkbox->GetValue());
input->Refresh();
return sizer_row;
}
wxBoxSizer* PreferencesDialog::create_item_darkmode(wxString title,wxString tooltip, std::string param)
{
wxBoxSizer* m_sizer_checkbox = new wxBoxSizer(wxHORIZONTAL);
@ -1266,6 +1334,12 @@ void PreferencesDialog::create_items()
auto item_auto_arrange = create_item_checkbox(_L("Auto arrange plate after cloning"), "", "auto_arrange");
g_sizer->Add(item_auto_arrange);
auto item_auto_reslice = create_item_auto_reslice(
_L("Auto slice after changes"),
_L("If enabled, OrcaSlicer will re-slice automatically whenever slicing-related settings change."),
_L("Delay in seconds before auto slicing starts, allowing multiple edits to be grouped. Use 0 to slice immediately."));
g_sizer->Add(item_auto_reslice);
//// CONTROL > Camera
g_sizer->Add(create_item_title(_L("Camera")), 1, wxEXPAND);
@ -1712,7 +1786,7 @@ wxBoxSizer* PreferencesDialog::create_debug_page()
wxGetApp().request_user_logout();
agent->set_country_code(country_code);
}
ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Warning"), ConfirmBeforeSendDialog::ButtonStyle::ONLY_CONFIRM);
ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Warning"), ConfirmBeforeSendDialog::VisibleButtons::ONLY_CONFIRM); // ORCA VisibleButtons instead ButtonStyle
confirm_dlg.update_text(_L("Cloud environment switched, please login again!"));
confirm_dlg.on_show();
}

View file

@ -94,6 +94,7 @@ public:
wxBoxSizer *create_item_input(wxString title, wxString title2, wxString tooltip, std::string param, std::function<void(wxString)> onchange = {});
wxBoxSizer *create_camera_orbit_mult_input(wxString title, wxString tooltip);
wxBoxSizer *create_item_backup(wxString title, wxString tooltip);
wxBoxSizer *create_item_auto_reslice(wxString title, wxString checkbox_tooltip, wxString delay_tooltip);
wxBoxSizer *create_item_multiple_combobox(wxString title, wxString tooltip, std::string parama, std::vector<wxString> vlista, std::vector<wxString> vlistb);
#ifdef WIN32
wxBoxSizer *create_item_link_association(wxString url_prefix, wxString website_name);

View file

@ -31,7 +31,7 @@ static std::string url_encode(const std::string& value) {
return escaped.str();
}
PrivacyUpdateDialog::PrivacyUpdateDialog(wxWindow* parent, wxWindowID id, const wxString& title, enum ButtonStyle btn_style, const wxPoint& pos, const wxSize& size, long style)
PrivacyUpdateDialog::PrivacyUpdateDialog(wxWindow* parent, wxWindowID id, const wxString& title, enum VisibleButtons btn_style, const wxPoint& pos, const wxSize& size, long style) // ORCA VisibleButtons instead ButtonStyle
:DPIDialog(parent, id, title, pos, size, style)
{
SetBackgroundColour(*wxWHITE);
@ -63,11 +63,6 @@ PrivacyUpdateDialog::PrivacyUpdateDialog(wxWindow* parent, wxWindowID id, const
m_sizer_right->Add(m_vebview_release_note, 0, wxEXPAND | wxRIGHT | wxLEFT, FromDIP(15));
auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(220, 220, 220), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Normal));
#ifndef __WINDOWS__
m_vebview_release_note->Bind(wxEVT_WEBVIEW_LOADED, [this](auto& e) {
@ -83,13 +78,7 @@ PrivacyUpdateDialog::PrivacyUpdateDialog(wxWindow* parent, wxWindowID id, const
//m_vebview_release_note->Bind(wxEVT_WEBVIEW_NAVIGATING , &PrivacyUpdateDialog::OnNavigating, this);
m_button_ok = new Button(this, _L("Accept"));
m_button_ok->SetBackgroundColor(btn_bg_green);
m_button_ok->SetBorderColor(*wxWHITE);
m_button_ok->SetTextColor(wxColour("#FFFFFE"));
m_button_ok->SetFont(Label::Body_12);
m_button_ok->SetSize(wxSize(-1, FromDIP(36)));
m_button_ok->SetMinSize(wxSize(-1, FromDIP(36)));
m_button_ok->SetCornerRadius(FromDIP(3));
m_button_ok->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) {
wxCommandEvent evt(EVT_PRIVACY_UPDATE_CONFIRM, GetId());
@ -99,12 +88,7 @@ PrivacyUpdateDialog::PrivacyUpdateDialog(wxWindow* parent, wxWindowID id, const
});
m_button_cancel = new Button(this, _L("Log Out"));
m_button_cancel->SetBackgroundColor(btn_bg_white);
m_button_cancel->SetBorderColor(*wxWHITE);
m_button_cancel->SetFont(Label::Body_12);
m_button_cancel->SetSize(wxSize(-1, FromDIP(36)));
m_button_cancel->SetMinSize(wxSize(-1, FromDIP(36)));
m_button_cancel->SetCornerRadius(FromDIP(3));
m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) {
wxCommandEvent evt(EVT_PRIVACY_UPDATE_CANCEL);

View file

@ -17,7 +17,7 @@ wxDECLARE_EVENT(EVT_PRIVACY_UPDATE_CANCEL, wxCommandEvent);
class PrivacyUpdateDialog : public DPIDialog
{
public:
enum ButtonStyle {
enum VisibleButtons { // ORCA VisibleButtons instead ButtonStyle
ONLY_CONFIRM = 0,
CONFIRM_AND_CANCEL = 1,
MAX_STYLE_NUM = 2
@ -26,7 +26,7 @@ public:
wxWindow* parent,
wxWindowID id = wxID_ANY,
const wxString& title = wxEmptyString,
enum ButtonStyle btn_style = CONFIRM_AND_CANCEL,
enum VisibleButtons btn_style = CONFIRM_AND_CANCEL, // ORCA VisibleButtons instead ButtonStyle
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxPD_APP_MODAL| wxCAPTION

View file

@ -4,6 +4,7 @@
#include <wx/dcgraph.h>
#include <wx/dcmemory.h>
#include <slic3r/GUI/Widgets/Label.hpp>
#include <slic3r/GUI/Widgets/DialogButtons.hpp>
#define BORDER FromDIP(25)
#define DRAW_PANEL_SIZE wxSize(FromDIP(475), FromDIP(100))
@ -27,34 +28,13 @@ RecenterDialog::RecenterDialog(wxWindow* parent, wxWindowID id, const wxString&
wxPanel* m_line_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
m_line_top->SetBackgroundColour(wxColour(166, 169, 170));
m_button_confirm = new Button(this, _L("Go Home"));
m_button_confirm->SetFont(Label::Body_14);
m_button_confirm->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_confirm->SetCornerRadius(FromDIP(12));
StateColor confirm_btn_bg(std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_confirm->SetBackgroundColor(confirm_btn_bg);
m_button_confirm->SetBorderColor(wxColour(0, 150, 136));
m_button_confirm->SetTextColor(*wxWHITE);
m_button_close = new Button(this, _L("Close"));
m_button_close->SetFont(Label::Body_14);
m_button_close->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_close->SetCornerRadius(FromDIP(12));
StateColor close_btn_bg(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_close->SetBackgroundColor(close_btn_bg);
m_button_close->SetBorderColor(wxColour(38, 46, 48));
m_button_close->SetTextColor(wxColour(38, 46, 48));
button_sizer->AddStretchSpacer();
button_sizer->Add(m_button_confirm);
button_sizer->AddSpacer(FromDIP(20));
button_sizer->Add(m_button_close);
auto dlg_btns = new DialogButtons(this, {"OK", "Cancel"});
dlg_btns->GetOK()->SetLabel(_L("Go Home"));
dlg_btns->GetCANCEL()->SetLabel(_L("Close"));
main_sizer->Add(m_line_top, 0, wxEXPAND, 0);
main_sizer->AddSpacer(DRAW_PANEL_SIZE.y);
main_sizer->Add(button_sizer, 0, wxBOTTOM | wxRIGHT | wxEXPAND, BORDER);
main_sizer->Add(dlg_btns, 0, wxBOTTOM | wxRIGHT | wxEXPAND, FromDIP(ButtonProps::ChoiceButtonGap()));
SetSizer(main_sizer);
@ -65,8 +45,8 @@ RecenterDialog::RecenterDialog(wxWindow* parent, wxWindowID id, const wxString&
Layout();
Fit();
this->Bind(wxEVT_PAINT, &RecenterDialog::OnPaint, this);
m_button_confirm->Bind(wxEVT_BUTTON, &RecenterDialog::on_button_confirm, this);
m_button_close->Bind(wxEVT_BUTTON, &RecenterDialog::on_button_close, this);
dlg_btns->GetOK()->Bind(wxEVT_BUTTON, &RecenterDialog::on_button_confirm, this);
dlg_btns->GetCANCEL()->Bind(wxEVT_BUTTON, &RecenterDialog::on_button_close, this);
wxGetApp().UpdateDlgDarkUI(this);
}
@ -178,10 +158,7 @@ void RecenterDialog::on_button_close(wxCommandEvent& event) {
void RecenterDialog::on_dpi_changed(const wxRect& suggested_rect) {
init_bitmap();
m_button_confirm->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_confirm->SetCornerRadius(FromDIP(12));
m_button_close->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_close->SetCornerRadius(FromDIP(12));
// ORCA no need to reapply button sizes
Layout();
}

View file

@ -11,8 +11,6 @@ class RecenterDialog : public DPIDialog
{
private:
wxStaticText* m_staticText_hint;
Button* m_button_confirm;
Button* m_button_close;
wxStaticBitmap* m_bitmap_home;
ScalableBitmap m_home_bmp;
wxString hint1;

View file

@ -147,32 +147,15 @@ UpdatePluginDialog::UpdatePluginDialog(wxWindow* parent /*= nullptr*/)
auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
auto m_button_ok = new Button(this, _L("OK"));
m_button_ok->SetBackgroundColor(btn_bg_green);
m_button_ok->SetBorderColor(*wxWHITE);
m_button_ok->SetTextColor(wxColour(0xFFFFFE));
m_button_ok->SetFont(Label::Body_12);
m_button_ok->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetCornerRadius(FromDIP(12));
m_button_ok->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) {
EndModal(wxID_OK);
});
auto m_button_cancel = new Button(this, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white);
m_button_cancel->SetBorderColor(wxColour(38, 46, 48));
m_button_cancel->SetFont(Label::Body_12);
m_button_cancel->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetCornerRadius(FromDIP(12));
m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) {
EndModal(wxID_NO);
@ -319,33 +302,15 @@ UpdateVersionDialog::UpdateVersionDialog(wxWindow *parent)
auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_download = new Button(this, _L("Download"));
m_button_download->SetBackgroundColor(btn_bg_green);
m_button_download->SetBorderColor(*wxWHITE);
m_button_download->SetTextColor(wxColour("#FFFFFE"));
m_button_download->SetFont(Label::Body_12);
m_button_download->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_download->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_download->SetCornerRadius(FromDIP(12));
m_button_download->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_download->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
EndModal(wxID_YES);
});
m_button_skip_version = new Button(this, _L("Skip this Version"));
m_button_skip_version->SetBackgroundColor(btn_bg_white);
m_button_skip_version->SetBorderColor(wxColour(38, 46, 48));
m_button_skip_version->SetFont(Label::Body_12);
m_button_skip_version->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_skip_version->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_skip_version->SetCornerRadius(FromDIP(12));
m_button_skip_version->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_skip_version->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
wxGetApp().set_skip_version(true);
@ -365,12 +330,7 @@ UpdateVersionDialog::UpdateVersionDialog(wxWindow *parent)
stable_only_label->SetFont(Label::Body_12);
m_button_cancel = new Button(this, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white);
m_button_cancel->SetBorderColor(wxColour(38, 46, 48));
m_button_cancel->SetFont(Label::Body_12);
m_button_cancel->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetCornerRadius(FromDIP(12));
m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
EndModal(wxID_NO);
@ -537,7 +497,7 @@ void UpdateVersionDialog::update_version_info(wxString release_note, wxString ve
Fit();
}
SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, const wxString& title, enum ButtonStyle btn_style, const wxPoint& pos, const wxSize& size, long style, bool not_show_again_check)
SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, const wxString& title, enum VisibleButtons btn_style, const wxPoint& pos, const wxSize& size, long style, bool not_show_again_check) // ORCA VisibleButtons instead ButtonStyle
:DPIFrame(parent, id, title, pos, size, style)
{
m_button_style = btn_style;
@ -562,12 +522,6 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons
auto bottom_sizer = new wxBoxSizer(wxVERTICAL);
auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
btn_bg_green = StateColor(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
btn_bg_white = StateColor(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
if (not_show_again_check) {
auto checkbox_sizer = new wxBoxSizer(wxHORIZONTAL);
@ -581,14 +535,7 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons
bottom_sizer->Add(checkbox_sizer, 0, wxBOTTOM | wxEXPAND, 0);
}
m_button_ok = new Button(this, _L("Confirm"));
m_button_ok->SetBackgroundColor(btn_bg_green);
m_button_ok->SetBorderColor(*wxWHITE);
m_button_ok->SetTextColor(wxColour("#FFFFFE"));
m_button_ok->SetFont(Label::Body_12);
m_button_ok->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_ok->SetMaxSize(wxSize(-1, FromDIP(24)));
m_button_ok->SetCornerRadius(FromDIP(12));
m_button_ok->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_ok->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent& e) {
wxCommandEvent evt(EVT_SECONDARY_CHECK_CONFIRM, GetId());
@ -598,14 +545,7 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons
});
m_button_retry = new Button(this, _L("Retry"));
m_button_retry->SetBackgroundColor(btn_bg_green);
m_button_retry->SetBorderColor(*wxWHITE);
m_button_retry->SetTextColor(wxColour("#FFFFFE"));
m_button_retry->SetFont(Label::Body_12);
m_button_retry->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_retry->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_retry->SetMaxSize(wxSize(-1, FromDIP(24)));
m_button_retry->SetCornerRadius(FromDIP(12));
m_button_retry->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_retry->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent& e) {
wxCommandEvent evt(EVT_SECONDARY_CHECK_RETRY, GetId());
@ -615,13 +555,7 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons
});
m_button_cancel = new Button(this, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white);
m_button_cancel->SetBorderColor(wxColour(38, 46, 48));
m_button_cancel->SetFont(Label::Body_12);
m_button_cancel->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_cancel->SetMaxSize(wxSize(-1, FromDIP(24)));
m_button_cancel->SetCornerRadius(FromDIP(12));
m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_cancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent& e) {
wxCommandEvent evt(EVT_SECONDARY_CHECK_CANCEL);
@ -631,13 +565,7 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons
});
m_button_fn = new Button(this, _L("Done"));
m_button_fn->SetBackgroundColor(btn_bg_white);
m_button_fn->SetBorderColor(wxColour(38, 46, 48));
m_button_fn->SetFont(Label::Body_12);
m_button_fn->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_fn->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_fn->SetMaxSize(wxSize(-1, FromDIP(24)));
m_button_fn->SetCornerRadius(FromDIP(12));
m_button_fn->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_fn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent& e) {
post_event(wxCommandEvent(EVT_SECONDARY_CHECK_DONE));
@ -645,13 +573,7 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons
});
m_button_resume = new Button(this, _L("Resume"));
m_button_resume->SetBackgroundColor(btn_bg_white);
m_button_resume->SetBorderColor(wxColour(38, 46, 48));
m_button_resume->SetFont(Label::Body_12);
m_button_resume->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_resume->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_resume->SetMaxSize(wxSize(-1, FromDIP(24)));
m_button_resume->SetCornerRadius(FromDIP(12));
m_button_resume->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_resume->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent& e) {
post_event(wxCommandEvent(EVT_SECONDARY_CHECK_RESUME));
@ -782,7 +704,7 @@ void SecondaryCheckDialog::on_hide()
}
}
void SecondaryCheckDialog::update_title_style(wxString title, SecondaryCheckDialog::ButtonStyle style, wxWindow* parent)
void SecondaryCheckDialog::update_title_style(wxString title, SecondaryCheckDialog::VisibleButtons style, wxWindow* parent) // ORCA VisibleButtons instead ButtonStyle
{
if (m_button_style == style && title == GetTitle()) return;
@ -866,9 +788,6 @@ PrintErrorDialog::PrintErrorDialog(wxWindow* parent, wxWindowID id, const wxStri
{
SetBackgroundColour(*wxWHITE);
btn_bg_white = StateColor(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_sizer_main = new wxBoxSizer(wxVERTICAL);
auto m_line_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(FromDIP(350), 1));
m_line_top->SetBackgroundColour(wxColour(166, 169, 170));
@ -1102,13 +1021,10 @@ void PrintErrorDialog::update_title_style(wxString title, std::vector<int> butto
void PrintErrorDialog::init_button(PrintErrorButton style,wxString buton_text)
{
Button* print_error_button = new Button(this, buton_text);
print_error_button->SetBackgroundColor(btn_bg_white);
print_error_button->SetBorderColor(wxColour(38, 46, 48));
print_error_button->SetFont(Label::Body_14);
print_error_button->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
print_error_button->SetSize(wxSize(FromDIP(300), FromDIP(30)));
print_error_button->SetMinSize(wxSize(FromDIP(300), FromDIP(30)));
print_error_button->SetMaxSize(wxSize(-1, FromDIP(30)));
print_error_button->SetCornerRadius(FromDIP(5));
print_error_button->Hide();
m_button_list[style] = print_error_button;
m_button_list[style]->Bind(wxEVT_LEFT_DOWN, [this, style](wxMouseEvent& e)
@ -1167,7 +1083,7 @@ void PrintErrorDialog::rescale()
}
}
ConfirmBeforeSendDialog::ConfirmBeforeSendDialog(wxWindow* parent, wxWindowID id, const wxString& title, enum ButtonStyle btn_style, const wxPoint& pos, const wxSize& size, long style, bool not_show_again_check)
ConfirmBeforeSendDialog::ConfirmBeforeSendDialog(wxWindow* parent, wxWindowID id, const wxString& title, enum VisibleButtons btn_style, const wxPoint& pos, const wxSize& size, long style, bool not_show_again_check)
:DPIDialog(parent, id, title, pos, size, style)
{
SetBackgroundColour(*wxWHITE);
@ -1190,12 +1106,6 @@ ConfirmBeforeSendDialog::ConfirmBeforeSendDialog(wxWindow* parent, wxWindowID id
auto bottom_sizer = new wxBoxSizer(wxVERTICAL);
auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
if (not_show_again_check) {
auto checkbox_sizer = new wxBoxSizer(wxHORIZONTAL);
@ -1209,13 +1119,7 @@ ConfirmBeforeSendDialog::ConfirmBeforeSendDialog(wxWindow* parent, wxWindowID id
bottom_sizer->Add(checkbox_sizer, 0, wxBOTTOM | wxEXPAND, 0);
}
m_button_ok = new Button(this, _L("Confirm"));
m_button_ok->SetBackgroundColor(btn_bg_green);
m_button_ok->SetBorderColor(*wxWHITE);
m_button_ok->SetTextColor(wxColour("#FFFFFE"));
m_button_ok->SetFont(Label::Body_12);
m_button_ok->SetSize(wxSize(-1, FromDIP(24)));
m_button_ok->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetCornerRadius(FromDIP(12));
m_button_ok->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) {
wxCommandEvent evt(EVT_SECONDARY_CHECK_CONFIRM, GetId());
@ -1225,12 +1129,7 @@ ConfirmBeforeSendDialog::ConfirmBeforeSendDialog(wxWindow* parent, wxWindowID id
});
m_button_cancel = new Button(this, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white);
m_button_cancel->SetBorderColor(wxColour(38, 46, 48));
m_button_cancel->SetFont(Label::Body_12);
m_button_cancel->SetSize(wxSize(-1, FromDIP(24)));
m_button_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetCornerRadius(FromDIP(12));
m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) {
wxCommandEvent evt(EVT_SECONDARY_CHECK_CANCEL);
@ -1245,12 +1144,7 @@ ConfirmBeforeSendDialog::ConfirmBeforeSendDialog(wxWindow* parent, wxWindowID id
m_button_cancel->Show();
m_button_update_nozzle = new Button(this, _L("Confirm and Update Nozzle"));
m_button_update_nozzle->SetBackgroundColor(btn_bg_white);
m_button_update_nozzle->SetBorderColor(wxColour(38, 46, 48));
m_button_update_nozzle->SetFont(Label::Body_12);
m_button_update_nozzle->SetSize(wxSize(-1, FromDIP(24)));
m_button_update_nozzle->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_update_nozzle->SetCornerRadius(FromDIP(12));
m_button_update_nozzle->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_update_nozzle->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) {
wxCommandEvent evt(EVT_UPDATE_NOZZLE);
@ -1445,18 +1339,12 @@ void ConfirmBeforeSendDialog::edit_cancel_button_txt(const wxString& txt, bool s
void ConfirmBeforeSendDialog::disable_button_ok()
{
m_button_ok->Disable();
m_button_ok->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_ok->SetBorderColor(wxColour(0x90, 0x90, 0x90));
m_button_ok->Disable(); // ORCA enabling / disabling buttons with conditions enough to change its style
}
void ConfirmBeforeSendDialog::enable_button_ok()
{
m_button_ok->Enable();
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
m_button_ok->SetBackgroundColor(btn_bg_green);
m_button_ok->SetBorderColor(btn_bg_green);
m_button_ok->Enable(); // ORCA enabling / disabling buttons with conditions enough to change its style
}
void ConfirmBeforeSendDialog::rescale()
@ -1628,41 +1516,22 @@ InputIpAddressDialog::InputIpAddressDialog(wxWindow *parent)
auto m_sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_ok = new Button(this, _L("Connect"));
m_button_ok->SetBackgroundColor(btn_bg_green);
m_button_ok->SetBorderColor(*wxWHITE);
m_button_ok->SetTextColor(wxColour(0xFFFFFE));
m_button_ok->SetFont(Label::Body_12);
m_button_ok->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetCornerRadius(FromDIP(12));
m_button_ok->Bind(wxEVT_LEFT_DOWN, &InputIpAddressDialog::on_ok, this);
m_button_ok->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_ok->Enable(false);
m_button_ok->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_ok->SetBorderColor(wxColour(0x90, 0x90, 0x90));
m_button_ok->Bind(wxEVT_LEFT_DOWN, &InputIpAddressDialog::on_ok, this);
m_button_manual_setup = new Button(this, _L("Manual Setup"));
m_button_manual_setup->SetBackgroundColor(btn_bg_green);
m_button_manual_setup->SetBorderColor(*wxWHITE);
m_button_manual_setup->SetTextColor(wxColour(0xFFFFFE));
m_button_manual_setup->SetFont(Label::Body_12);
m_button_manual_setup->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_manual_setup->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_manual_setup->SetCornerRadius(FromDIP(12));
m_button_manual_setup->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_manual_setup->Enable(false);
m_button_manual_setup->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent&) {
wxCommandEvent event(EVT_CHECK_IP_ADDRESS_LAYOUT);
event.SetEventObject(this);
event.SetInt(1);
wxPostEvent(this, event);
});
m_button_manual_setup->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_manual_setup->SetBorderColor(wxColour(0x90, 0x90, 0x90));
m_button_manual_setup->Hide();
m_sizer_button->AddStretchSpacer();
@ -1803,9 +1672,8 @@ void InputIpAddressDialog::switch_input_panel(int index)
m_step_icon_panel3->Show();
m_tip3->Show();
// ORCA enabling / disabling buttons with conditions enough to change its style
m_button_ok->Enable(false);
m_button_ok->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_ok->SetBorderColor(wxColour(0x90, 0x90, 0x90));
}
current_input_index = index;
}
@ -1842,18 +1710,8 @@ void InputIpAddressDialog::set_machine_obj(MachineObject* obj)
auto str_ip = m_input_ip->GetTextCtrl()->GetValue();
auto str_access_code = m_input_access_code->GetTextCtrl()->GetValue();
if (isIp(str_ip.ToStdString()) && str_access_code.Length() == 8) {
m_button_ok->Enable(true);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
m_button_ok->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_ok->SetBackgroundColor(btn_bg_green);
}
else {
m_button_ok->Enable(false);
m_button_ok->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_ok->SetBorderColor(wxColour(0x90, 0x90, 0x90));
}
// ORCA enabling / disabling buttons with conditions enough to change its style
m_button_ok->Enable(isIp(str_ip.ToStdString()) && str_access_code.Length() == 8);
Layout();
Fit();
@ -1929,12 +1787,9 @@ void InputIpAddressDialog::on_ok(wxMouseEvent& evt)
str_model_id = it->second;
}
// ORCA enabling / disabling buttons with conditions enough to change its style
m_button_manual_setup->Enable(false);
m_button_manual_setup->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_manual_setup->SetBorderColor(wxColour(0x90, 0x90, 0x90));
m_button_ok->Enable(false);
m_button_ok->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_ok->SetBorderColor(wxColour(0x90, 0x90, 0x90));
Refresh();
Layout();
@ -1971,9 +1826,7 @@ void InputIpAddressDialog::on_send_retry()
return;
}
m_button_ok->Enable(false);
m_button_ok->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_ok->SetBorderColor(wxColour(0x90, 0x90, 0x90));
m_button_ok->Enable(false); // ORCA enabling / disabling buttons with conditions enough to change its style
m_worker->wait_for_idle();
@ -2170,10 +2023,7 @@ void InputIpAddressDialog::on_check_ip_address_failed(wxCommandEvent& evt)
}
m_button_ok->Enable(true);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
m_button_ok->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_ok->SetBackgroundColor(btn_bg_green);
// ORCA enabling / disabling buttons with conditions enough to change its style
}
void InputIpAddressDialog::on_text(wxCommandEvent &evt)
@ -2191,34 +2041,14 @@ void InputIpAddressDialog::on_text(wxCommandEvent &evt)
}
}
const auto enable_btn = [](Button* btn, bool enabled) {
btn->Enable(enabled);
if (enabled) {
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
btn->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
btn->SetBackgroundColor(btn_bg_green);
} else {
btn->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
btn->SetBorderColor(wxColour(0x90, 0x90, 0x90));
}
};
// ORCA enabling / disabling buttons with conditions enough to change its style
bool enable_btns = isIp(str_ip.ToStdString()) && str_access_code.Length() == 8 && invalid_access_code;
m_button_manual_setup->Enable(enable_btns);
m_button_ok->Enable(enable_btns);
if (isIp(str_ip.ToStdString()) && str_access_code.Length() == 8 && invalid_access_code) {
enable_btn(m_button_manual_setup, true);
enable_btn(m_button_ok, true);
} else {
enable_btn(m_button_manual_setup, false);
enable_btn(m_button_ok, false);
}
if (current_input_index == 1)
m_button_ok->Enable(!str_name.IsEmpty() && str_sn.length() == 15);
if (current_input_index == 1){
if (!str_name.IsEmpty() && str_sn.length() == 15) {
enable_btn(m_button_ok, true);
} else {
enable_btn(m_button_ok, false);
}
}
}
InputIpAddressDialog::~InputIpAddressDialog()
@ -2242,9 +2072,6 @@ void InputIpAddressDialog::on_dpi_changed(const wxRect& suggested_rect)
SetMinSize(wxSize(FromDIP(560), -1));
SetMaxSize(wxSize(FromDIP(560), -1));
std::string icon_path = (boost::format("%1%/images/OrcaSlicerTitle.ico") % resources_dir()).str();
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
SetBackgroundColour(*wxWHITE);
auto m_sizer_main = new wxBoxSizer(wxVERTICAL);
auto m_line_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(FromDIP(400), 1));
@ -2258,34 +2085,15 @@ void InputIpAddressDialog::on_dpi_changed(const wxRect& suggested_rect)
wxBoxSizer *button_sizer = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
auto m_button_retry = new Button(this, _L("Retry"));
m_button_retry->SetBackgroundColor(btn_bg_green);
m_button_retry->SetBorderColor(*wxWHITE);
m_button_retry->SetTextColor(wxColour("#FFFFFE"));
m_button_retry->SetFont(Label::Body_12);
m_button_retry->SetSize(wxSize(-1, FromDIP(24)));
m_button_retry->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_retry->SetCornerRadius(FromDIP(12));
m_button_retry->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_retry->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
EndModal(wxYES);
});
auto m_button_input = new Button(this, _L("reconnect"));
m_button_input->SetBackgroundColor(btn_bg_white);
m_button_input->SetBorderColor(wxColour(38, 46, 48));
m_button_input->SetFont(Label::Body_12);
m_button_input->SetSize(wxSize(-1, FromDIP(24)));
m_button_input->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_input->SetCornerRadius(FromDIP(12));
m_button_input->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_input->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
EndModal(wxAPPLY);
});

View file

@ -114,7 +114,7 @@ class SecondaryCheckDialog : public DPIFrame
private:
wxWindow* event_parent { nullptr };
public:
enum ButtonStyle {
enum VisibleButtons { // ORCA VisibleButtons instead ButtonStyle
ONLY_CONFIRM = 0,
CONFIRM_AND_CANCEL = 1,
CONFIRM_AND_DONE = 2,
@ -127,7 +127,7 @@ public:
wxWindow* parent,
wxWindowID id = wxID_ANY,
const wxString& title = wxEmptyString,
enum ButtonStyle btn_style = CONFIRM_AND_CANCEL,
enum VisibleButtons btn_style = CONFIRM_AND_CANCEL, // ORCA VisibleButtons instead ButtonStyle
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCLOSE_BOX | wxCAPTION,
@ -137,7 +137,7 @@ public:
void on_show();
void on_hide();
void update_btn_label(wxString ok_btn_text, wxString cancel_btn_text);
void update_title_style(wxString title, SecondaryCheckDialog::ButtonStyle style, wxWindow* parent = nullptr);
void update_title_style(wxString title, SecondaryCheckDialog::VisibleButtons style, wxWindow* parent = nullptr); // ORCA VisibleButtons instead ButtonStyle
void post_event(wxCommandEvent&& event);
void rescale();
~SecondaryCheckDialog();
@ -156,7 +156,7 @@ public:
Button* m_button_fn { nullptr };
Button* m_button_resume { nullptr };
wxCheckBox* m_show_again_checkbox;
ButtonStyle m_button_style;
VisibleButtons m_button_style; // ORCA VisibleButtons instead ButtonStyle
bool not_show_again = false;
std::string show_again_config_text = "";
};
@ -215,7 +215,6 @@ public:
void init_button_list();
void on_webrequest_state(wxWebRequestEvent& evt);
StateColor btn_bg_white;
wxWebRequest web_request;
wxStaticBitmap* m_error_prompt_pic_static;
Label* m_staticText_release_note{ nullptr };
@ -243,7 +242,7 @@ public:
class ConfirmBeforeSendDialog : public DPIDialog
{
public:
enum ButtonStyle {
enum VisibleButtons { // ORCA VisibleButtons instead ButtonStyle
ONLY_CONFIRM = 0,
CONFIRM_AND_CANCEL = 1,
MAX_STYLE_NUM = 2
@ -252,7 +251,7 @@ public:
wxWindow* parent,
wxWindowID id = wxID_ANY,
const wxString& title = wxEmptyString,
enum ButtonStyle btn_style = CONFIRM_AND_CANCEL,
enum VisibleButtons btn_style = CONFIRM_AND_CANCEL, // ORCA VisibleButtons instead ButtonStyle
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCLOSE_BOX | wxCAPTION,

View file

@ -575,15 +575,8 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
wxBoxSizer *m_sizer_prepare = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer *m_sizer_pcont = new wxBoxSizer(wxVERTICAL);
m_btn_bg_enable = StateColor(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_ensure = new Button(m_panel_prepare, _L("Send"));
m_button_ensure->SetBackgroundColor(m_btn_bg_enable);
m_button_ensure->SetBorderColor(m_btn_bg_enable);
m_button_ensure->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_ensure->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE2);
m_button_ensure->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE2);
m_button_ensure->SetCornerRadius(FromDIP(4));
m_button_ensure->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_ensure->Bind(wxEVT_BUTTON, &SelectMachineDialog::on_ok_btn, this);
m_sizer_pcont->Add(0, 0, 1, wxEXPAND, 0);
@ -3661,14 +3654,12 @@ void SelectMachineDialog::Enable_Send_Button(bool en)
if (!en) {
if (m_button_ensure->IsEnabled()) {
m_button_ensure->Disable();
m_button_ensure->SetBackgroundColor(wxColour(200, 200, 200));
m_button_ensure->SetBorderColor(wxColour(200, 200, 200));
// ORCA no need to set colors again
}
} else {
if (!m_button_ensure->IsEnabled()) {
m_button_ensure->Enable();
m_button_ensure->SetBackgroundColor(m_btn_bg_enable);
m_button_ensure->SetBorderColor(m_btn_bg_enable);
// ORCA no need to set colors again
}
}
}
@ -3685,8 +3676,7 @@ void SelectMachineDialog::on_dpi_changed(const wxRect &suggested_rect)
ams_mapping_help_icon->msw_rescale();
if (img_amsmapping_tip)img_amsmapping_tip->SetBitmap(ams_mapping_help_icon->bmp());
}
m_button_ensure->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE2);
m_button_ensure->SetCornerRadius(FromDIP(4));
m_button_ensure->Rescale(); // ORCA
m_status_bar->msw_rescale();
for (auto material1 : m_materialList) {

View file

@ -341,12 +341,8 @@ void SendMultiMachinePage::on_dpi_changed(const wxRect& suggested_rect)
print_weight->msw_rescale();
timeimg->SetBitmap(print_time->bmp());
weightimg->SetBitmap(print_weight->bmp());
m_button_add->Rescale();
m_button_add->SetMinSize(wxSize(FromDIP(90), FromDIP(36)));
m_button_add->SetMaxSize(wxSize(FromDIP(90), FromDIP(36)));
m_button_send->Rescale();
m_button_send->SetMinSize(wxSize(FromDIP(120), FromDIP(40)));
m_button_send->SetMinSize(wxSize(FromDIP(120), FromDIP(40)));
m_button_add->Rescale(); // ORCA no need to re set size
m_button_send->Rescale(); // ORCA no need to re set size
for (auto it = m_device_items.begin(); it != m_device_items.end(); ++it) {
it->second->Refresh();
@ -1349,21 +1345,8 @@ wxPanel* SendMultiMachinePage::create_page()
m_tip_text->SetFont(::Label::Head_20);
m_tip_text->Wrap(-1);
auto m_btn_bg_enable = StateColor(
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
m_button_add = new Button(main_page, _L("Add"));
m_button_add->SetBackgroundColor(m_btn_bg_enable);
m_button_add->SetBorderColor(m_btn_bg_enable);
m_button_add->SetTextColor(*wxWHITE);
m_button_add->SetFont(Label::Body_12);
m_button_add->SetCornerRadius(6);
m_button_add->SetMinSize(wxSize(FromDIP(90), FromDIP(36)));
m_button_add->SetMaxSize(wxSize(FromDIP(90), FromDIP(36)));
m_button_add->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_button_add->Bind(wxEVT_BUTTON, [this](wxCommandEvent& evt) {
MultiMachinePickPage dlg;
dlg.ShowModal();
@ -1412,17 +1395,8 @@ wxPanel* SendMultiMachinePage::create_page()
sizer->AddSpacer(FromDIP(10));
// add send button
btn_bg_enable = StateColor(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_send = new Button(main_page, _L("Send"));
m_button_send->SetBackgroundColor(btn_bg_enable);
m_button_send->SetBorderColor(btn_bg_enable);
m_button_send->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_send->SetSize(wxSize(FromDIP(120), FromDIP(40)));
m_button_send->SetMinSize(wxSize(FromDIP(120), FromDIP(40)));
m_button_send->SetMinSize(wxSize(FromDIP(120), FromDIP(40)));
m_button_send->SetCornerRadius(FromDIP(5));
m_button_send->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_send->Bind(wxEVT_BUTTON, &SendMultiMachinePage::on_send, this);
//m_button_send->Disable();
//m_button_send->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));

View file

@ -285,16 +285,9 @@ SendToPrinterDialog::SendToPrinterDialog(Plater *plater)
m_comboBox_printer->Bind(wxEVT_COMBOBOX, &SendToPrinterDialog::on_selection_changed, this);
m_sizer_printer->Add(m_comboBox_printer, 1, wxEXPAND | wxRIGHT, FromDIP(5));
btn_bg_enable = StateColor(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_refresh = new Button(this, _L("Refresh"));
m_button_refresh->SetBackgroundColor(btn_bg_enable);
m_button_refresh->SetBorderColor(btn_bg_enable);
m_button_refresh->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_refresh->SetSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
m_button_refresh->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
m_button_refresh->SetCornerRadius(FromDIP(10));
m_button_refresh->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_button_refresh->Bind(wxEVT_BUTTON, &SendToPrinterDialog::on_refresh, this);
m_sizer_printer->Add(m_button_refresh, 0, wxALL | wxLEFT, FromDIP(5));
@ -347,12 +340,7 @@ SendToPrinterDialog::SendToPrinterDialog(Plater *plater)
m_sizer_prepare->Add(0, 0, 1, wxTOP, FromDIP(22));
m_sizer_pcont->Add(0, 0, 1, wxEXPAND, 0);
m_button_ensure = new Button(m_panel_prepare, _L("Send"));
m_button_ensure->SetBackgroundColor(btn_bg_enable);
m_button_ensure->SetBorderColor(btn_bg_enable);
m_button_ensure->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_ensure->SetSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
m_button_ensure->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
m_button_ensure->SetCornerRadius(6);
m_button_ensure->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_ensure->Bind(wxEVT_BUTTON, &SendToPrinterDialog::on_ok, this);
m_sizer_pcont->Add(m_button_ensure, 0, wxEXPAND | wxBOTTOM, FromDIP(10));
@ -1363,15 +1351,11 @@ void SendToPrinterDialog::Enable_Refresh_Button(bool en)
{
if (!en) {
if (m_button_refresh->IsEnabled()) {
m_button_refresh->Disable();
m_button_refresh->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_refresh->SetBorderColor(wxColour(0x90, 0x90, 0x90));
m_button_refresh->Disable(); // ORCA no need to set colors again
}
} else {
if (!m_button_refresh->IsEnabled()) {
m_button_refresh->Enable();
m_button_refresh->SetBackgroundColor(btn_bg_enable);
m_button_refresh->SetBorderColor(btn_bg_enable);
m_button_refresh->Enable(); // ORCA no need to set colors again
}
}
}
@ -1523,15 +1507,11 @@ void SendToPrinterDialog::Enable_Send_Button(bool en)
if (!en) {
if (m_button_ensure->IsEnabled()) {
m_button_ensure->Disable();
m_button_ensure->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_ensure->SetBorderColor(wxColour(0x90, 0x90, 0x90));
m_storage_panel->Hide();
}
} else {
if (!m_button_ensure->IsEnabled()) {
m_button_ensure->Enable();
m_button_ensure->SetBackgroundColor(btn_bg_enable);
m_button_ensure->SetBorderColor(btn_bg_enable);
m_storage_panel->Show();
}
}
@ -1539,10 +1519,8 @@ void SendToPrinterDialog::Enable_Send_Button(bool en)
void SendToPrinterDialog::on_dpi_changed(const wxRect &suggested_rect)
{
m_button_refresh->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
m_button_refresh->SetCornerRadius(FromDIP(12));
m_button_ensure->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
m_button_ensure->SetCornerRadius(FromDIP(12));
m_button_refresh->Rescale(); // ORCA
m_button_ensure->Rescale(); // ORCA
m_status_bar->msw_rescale();
Fit();
Refresh();

View file

@ -356,28 +356,13 @@ ExtruderSwithingStatus::ExtruderSwithingStatus(wxWindow *parent)
{ m_switching_status_label->SetBackgroundColour(parent->GetBackgroundColour());
}
StateColor e_ctrl_bg(std::pair<wxColour, int>(BUTTON_PRESS_COL, StateColor::Pressed), std::pair<wxColour, int>(BUTTON_NORMAL1_COL, StateColor::Normal));
StateColor e_ctrl_bd(std::pair<wxColour, int>(BUTTON_HOVER_COL, StateColor::Hovered), std::pair<wxColour, int>(BUTTON_NORMAL1_COL, StateColor::Normal));
m_button_quit = new Button(this, _CTX(L_CONTEXT("Quit", "Quit_Switching"), "Quit_Switching"), "", 0, FromDIP(22));
m_button_quit->SetFont(::Label::Body_13);
m_button_quit->SetStyle(ButtonStyle::Regular, ButtonType::Window);
m_button_quit->Bind(wxEVT_BUTTON, &ExtruderSwithingStatus::on_quit, this);
m_button_quit->SetMinSize(SWITCHING_STATUS_BTN_SIZE);
m_button_quit->SetMaxSize(SWITCHING_STATUS_BTN_SIZE);
m_button_quit->SetBackgroundColor(e_ctrl_bg);
m_button_quit->SetBorderColor(e_ctrl_bd);
m_button_quit->SetBorderWidth(2);
if (parent) { m_button_quit->SetBackgroundColour(parent->GetBackgroundColour()); }
m_button_retry = new Button(this, _L("Retry"), "", 0, FromDIP(22));
m_button_retry->SetFont(::Label::Body_13);
m_button_retry->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_button_retry->Bind(wxEVT_BUTTON, &ExtruderSwithingStatus::on_retry, this);
m_button_retry->SetMinSize(SWITCHING_STATUS_BTN_SIZE);
m_button_retry->SetMaxSize(SWITCHING_STATUS_BTN_SIZE);
m_button_retry->SetBackgroundColor(e_ctrl_bg);
m_button_retry->SetBorderColor(e_ctrl_bd);
m_button_retry->SetBorderWidth(2);
if (parent) { m_button_retry->SetBackgroundColour(parent->GetBackgroundColour()); }
wxBoxSizer *btn_sizer = new wxBoxSizer(wxHORIZONTAL);
btn_sizer->Add(m_button_quit, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(10));
@ -476,10 +461,8 @@ bool ExtruderSwithingStatus::has_content_shown() const
void ExtruderSwithingStatus::msw_rescale()
{
m_button_quit->SetMinSize(SWITCHING_STATUS_BTN_SIZE);
m_button_quit->SetMaxSize(SWITCHING_STATUS_BTN_SIZE);
m_button_retry->SetMinSize(SWITCHING_STATUS_BTN_SIZE);
m_button_retry->SetMaxSize(SWITCHING_STATUS_BTN_SIZE);
m_button_quit->Rescale(); // ORCA
m_button_retry->Rescale(); // ORCA
Layout();
}
@ -870,18 +853,7 @@ void PrintingTaskPanel::create_panel(wxWindow* parent)
static_text_sizer->Add(m_error_text, 1, wxEXPAND | wxLEFT, FromDIP(17));
m_button_clean = new Button(m_panel_error_txt, _L("Clear"));
StateColor clean_bg(std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Disabled), std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered), std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Enabled),
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal));
StateColor clean_bd(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
StateColor clean_text(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
m_button_clean->SetBackgroundColor(clean_bg);
m_button_clean->SetBorderColor(clean_bd);
m_button_clean->SetTextColor(clean_text);
m_button_clean->SetFont(Label::Body_10);
m_button_clean->SetMinSize(TASK_BUTTON_SIZE2);
m_button_clean->SetStyle(ButtonStyle::Regular, ButtonType::Window);
static_text_sizer->Add( FromDIP(10), 0, 0, 0, 0 );
static_text_sizer->Add(m_button_clean, 0, wxALIGN_CENTRE_VERTICAL|wxRIGHT, FromDIP(5));
@ -911,16 +883,10 @@ void PrintingTaskPanel::create_panel(wxWindow* parent)
m_request_failed_info->SetForegroundColour(*wxRED);
m_request_failed_info->SetFont(::Label::Body_10);
static_request_failed_panel_sizer->Add(m_request_failed_info, 0, wxEXPAND | wxALL, FromDIP(10));
StateColor btn_bg_green(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bd_green(std::pair<wxColour, int>(AMS_CONTROL_WHITE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Enabled));
m_button_market_retry = new Button(m_request_failed_panel, _L("Retry"));
m_button_market_retry->SetBackgroundColor(btn_bg_green);
m_button_market_retry->SetBorderColor(btn_bd_green);
m_button_market_retry->SetTextColor(wxColour("#FFFFFE"));
m_button_market_retry->SetSize(wxSize(FromDIP(128), FromDIP(26)));
m_button_market_retry->SetMinSize(wxSize(-1, FromDIP(26)));
m_button_market_retry->SetCornerRadius(FromDIP(13));
m_button_market_retry->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
static_request_failed_panel_sizer->Add(0, 0, 1, wxEXPAND, 0);
static_request_failed_panel_sizer->Add(m_button_market_retry, 0, wxEXPAND | wxALL, FromDIP(10));
m_request_failed_panel->SetSizer(static_request_failed_panel_sizer);
@ -969,12 +935,7 @@ void PrintingTaskPanel::create_panel(wxWindow* parent)
}
m_button_market_scoring = new Button(m_score_subtask_info, _L("Rate"));
m_button_market_scoring->SetBackgroundColor(btn_bg_green);
m_button_market_scoring->SetBorderColor(btn_bd_green);
m_button_market_scoring->SetTextColor(wxColour("#FFFFFE"));
m_button_market_scoring->SetSize(wxSize(FromDIP(128), FromDIP(26)));
m_button_market_scoring->SetMinSize(wxSize(-1, FromDIP(26)));
m_button_market_scoring->SetCornerRadius(FromDIP(13));
m_button_market_scoring->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_button_market_scoring->Enable(false);
static_score_star_sizer->Add(0, 0, 1, wxEXPAND, 0);
@ -1619,39 +1580,19 @@ wxBoxSizer *StatusBasePanel::create_machine_control_page(wxWindow *parent)
//m_staticText_control->SetFont(PAGE_TITLE_FONT);
m_staticText_control->SetForegroundColour(PAGE_TITLE_FONT_COL);
StateColor btn_bg_green(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bd_green(std::pair<wxColour, int>(AMS_CONTROL_WHITE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Enabled));
m_parts_btn = new Button(m_panel_control_title, _L("Printer Parts"));
m_parts_btn->SetBackgroundColor(btn_bg_green);
m_parts_btn->SetBorderColor(btn_bd_green);
m_parts_btn->SetTextColor(wxColour("#FFFFFE"));
m_parts_btn->SetSize(wxSize(FromDIP(128), FromDIP(26)));
m_parts_btn->SetMinSize(wxSize(-1, FromDIP(26)));
m_parts_btn->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_options_btn = new Button(m_panel_control_title, _L("Print Options"));
m_options_btn->SetBackgroundColor(btn_bg_green);
m_options_btn->SetBorderColor(btn_bd_green);
m_options_btn->SetTextColor(wxColour("#FFFFFE"));
m_options_btn->SetSize(wxSize(FromDIP(128), FromDIP(26)));
m_options_btn->SetMinSize(wxSize(-1, FromDIP(26)));
m_options_btn->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_safety_btn = new Button(m_panel_control_title, _L("Safety Options"));
m_safety_btn->SetBackgroundColor(btn_bg_green);
m_safety_btn->SetBorderColor(btn_bd_green);
m_safety_btn->SetTextColor(wxColour("#FFFFFE"));
m_safety_btn->SetSize(wxSize(FromDIP(128), FromDIP(26)));
m_safety_btn->SetMinSize(wxSize(-1, FromDIP(26)));
m_safety_btn->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_calibration_btn = new Button(m_panel_control_title, _L("Calibration"));
m_calibration_btn->SetBackgroundColor(btn_bg_green);
m_calibration_btn->SetBorderColor(btn_bd_green);
m_calibration_btn->SetTextColor(wxColour("#FFFFFE"));
m_calibration_btn->SetSize(wxSize(FromDIP(128), FromDIP(26)));
m_calibration_btn->SetMinSize(wxSize(-1, FromDIP(26)));
m_calibration_btn->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_calibration_btn->EnableTooltipEvenDisabled();
m_options_btn->Hide();
m_safety_btn->Hide();
@ -2171,18 +2112,8 @@ wxBoxSizer* StatusBasePanel::create_filament_group(wxWindow* parent)
steps_sizer->Add(m_filament_load_img, 0, wxALIGN_TOP, FromDIP(30));
steps_sizer->AddStretchSpacer();
StateColor btn_bd_white(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
StateColor btn_text_white(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
StateColor btn_bg_white(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Pressed),
std::pair<wxColour, int>(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_WHITE_COLOUR, StateColor::Normal));
m_button_retry = new Button(m_filament_load_box, _L("Retry"));
m_button_retry->SetFont(Label::Body_13);
m_button_retry->SetBorderColor(btn_bd_white);
m_button_retry->SetTextColor(btn_text_white);
m_button_retry->SetMinSize(wxSize(FromDIP(80), FromDIP(31)));
m_button_retry->SetBackgroundColor(btn_bg_white);
m_button_retry->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
//m_button_retry->Hide();
m_button_retry->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
@ -4052,7 +3983,7 @@ void StatusPanel::on_axis_ctrl_z_down_10(wxCommandEvent &event)
void StatusPanel::axis_ctrl_e_hint(bool up_down)
{
if (ctrl_e_hint_dlg == nullptr) {
/* ctrl_e_hint_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Warning"), SecondaryCheckDialog::ButtonStyle::CONFIRM_AND_CANCEL, wxDefaultPosition,
/* ctrl_e_hint_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Warning"), SecondaryCheckDialog::VisibleButtons::CONFIRM_AND_CANCEL, wxDefaultPosition,
ctrl_e_hint_dlg->update_text(_L("Please heat the nozzle to above 170°C before loading or unloading filament."));
ctrl_e_hint_dlg->m_show_again_checkbox->Hide();
ctrl_e_hint_dlg->m_button_cancel->Hide();
@ -4898,7 +4829,7 @@ void StatusPanel::on_camera_enter(wxMouseEvent& event)
m_camera_popup->Bind(EVT_VCAMERA_SWITCH, &StatusPanel::on_switch_vcamera, this);
m_camera_popup->Bind(EVT_SDCARD_ABSENT_HINT, [this](wxCommandEvent &e) {
if (sdcard_hint_dlg == nullptr) {
sdcard_hint_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Warning"), SecondaryCheckDialog::ButtonStyle::ONLY_CONFIRM);
sdcard_hint_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Warning"), SecondaryCheckDialog::VisibleButtons::ONLY_CONFIRM); // ORCA VisibleButtons instead ButtonStyle
sdcard_hint_dlg->update_text(_L("Can't start this without storage."));
}
sdcard_hint_dlg->on_show();
@ -5851,18 +5782,9 @@ wxBoxSizer *ScoreDialog::get_button_sizer()
wxBoxSizer *bSizer_button = new wxBoxSizer(wxHORIZONTAL);
bSizer_button->Add(0, 0, 1, wxEXPAND, 0);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
m_button_ok = new Button(this, _L("Submit"));
m_button_ok->SetBackgroundColor(btn_bg_green);
m_button_ok->SetBorderColor(*wxWHITE);
m_button_ok->SetTextColor(wxColour("#FFFFFE"));
m_button_ok->SetFont(Label::Body_12);
m_button_ok->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_button_ok, 0, wxRIGHT, FromDIP(24));
m_button_ok->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
bSizer_button->Add(m_button_ok, 0, wxRIGHT, FromDIP(ButtonProps::ChoiceButtonGap()));
m_button_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
m_upload_status_code = StatusCode::UPLOAD_PROGRESS;
@ -5997,17 +5919,9 @@ wxBoxSizer *ScoreDialog::get_button_sizer()
}
});
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_cancel = new Button(this, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white);
m_button_cancel->SetBorderColor(wxColour(38, 46, 48));
m_button_cancel->SetFont(Label::Body_12);
m_button_cancel->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_button_cancel, 0, wxRIGHT, FromDIP(24));
m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
bSizer_button->Add(m_button_cancel, 0, wxRIGHT, FromDIP(ButtonProps::ChoiceButtonGap()));
m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { EndModal(wxID_CANCEL); });

View file

@ -380,20 +380,23 @@ void Tab::create_preset_tab()
m_top_sizer->Add(m_undo_to_sys_btn, 0, wxALIGN_CENTER_VERTICAL);
m_top_sizer->AddSpacer(FromDIP(SidebarProps::IconSpacing()));
#endif
m_top_sizer->Add(m_btn_save_preset, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::IconSpacing()));
m_top_sizer->Add(m_btn_save_preset , 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::IconSpacing()));
m_top_sizer->Add(m_btn_delete_preset, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::IconSpacing()));
m_top_sizer->Add(m_btn_search, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::IconSpacing()));
m_top_sizer->Add(m_search_item, 1, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::ContentMargin()));
m_top_sizer->Add(m_btn_search , 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::WideSpacing()));
m_top_sizer->Add(m_search_item , 1, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::ContentMargin()));
if (dynamic_cast<TabPrint*>(this) == nullptr) {
m_static_title = new Label(m_top_panel, Label::Body_12, _L("Advance"));
m_static_title->Wrap( -1 );
// BBS: open this tab by select first
m_static_title->Bind(wxEVT_LEFT_UP, [this](auto& e) {
restore_last_select_item();
m_mode_icon = new ScalableButton(m_top_panel, wxID_ANY, "advanced"); // ORCA
m_mode_icon->SetToolTip(_L("Show/Hide advanced parameters"));
m_mode_icon->Bind(wxEVT_BUTTON, [this](wxCommandEvent e) {
m_mode_view->SetValue(!m_mode_view->GetValue());
wxCommandEvent evt(wxEVT_TOGGLEBUTTON, m_mode_view->GetId()); // ParamsPanel::OnToggled(evt)
evt.SetEventObject(m_mode_view);
m_mode_view->wxEvtHandler::ProcessEvent(evt);
});
m_top_sizer->Add(m_static_title, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::IconSpacing()));
m_top_sizer->Add(m_mode_icon, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::WideSpacing()));
m_mode_view = new SwitchButton(m_top_panel, wxID_ABOUT);
m_mode_view->SetToolTip(_L("Show/Hide advanced parameters"));
m_top_sizer->AddSpacer(FromDIP(SidebarProps::ElementSpacing()));
m_top_sizer->Add( m_mode_view, 0, wxALIGN_CENTER_VERTICAL);
}
@ -1911,7 +1914,9 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
}
}
if (m_preset_bundle->get_printer_extruder_count() > 1){
// Orca: allow different layer height for non-bbl printers
// TODO: allow this for BBL printers too?
if (m_preset_bundle->get_printer_extruder_count() > 1 && m_preset_bundle->is_bbl_vendor()) {
int extruder_idx = std::atoi(opt_key.substr(opt_key.find_last_of('#') + 1).c_str());
if (opt_key.find("min_layer_height") != std::string::npos) {
auto min_layer_height_from_nozzle = m_preset_bundle->full_config().option<ConfigOptionFloats>("min_layer_height")->values;

View file

@ -141,7 +141,7 @@ protected:
//BBS: GUI refactor
wxPanel* m_top_panel;
wxStaticText* m_static_title;
ScalableButton* m_mode_icon; // ORCA m_static_title replacement
wxBoxSizer* m_main_sizer;
wxBoxSizer* m_top_sizer;
wxBoxSizer* m_top_left_sizer;

View file

@ -1808,13 +1808,12 @@ FullCompareDialog::FullCompareDialog(const wxString& option_name, const wxString
sizer->Add(grid_sizer, 1, wxEXPAND);
wxStdDialogButtonSizer* buttons = this->CreateStdDialogButtonSizer(wxOK);
wxGetApp().UpdateDarkUI(static_cast<wxButton*>(this->FindWindowById(wxID_OK, this)), true);
auto dlg_btns = new DialogButtons(this, {"OK"});
wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
topSizer->Add(sizer, 1, wxEXPAND | wxLEFT | wxTOP | wxRIGHT, border);
topSizer->Add(buttons, 0, wxEXPAND | wxALL, border);
topSizer->Add(dlg_btns , 0, wxEXPAND);
SetSizer(topSizer);
topSizer->SetSizeHints(this);

View file

@ -137,32 +137,12 @@ MsgUpdateConfig::MsgUpdateConfig(const std::vector<Update> &updates, bool force_
auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
sizer_button->Add(0, 0, 1, wxEXPAND, 5);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
auto m_butto_ok = new Button(this, _L("OK"));
m_butto_ok->SetBackgroundColor(btn_bg_green);
m_butto_ok->SetBorderColor(*wxWHITE);
m_butto_ok->SetTextColor(*wxWHITE);
m_butto_ok->SetFont(Label::Body_12);
m_butto_ok->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_butto_ok->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_butto_ok->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
auto m_button_cancel = new Button(this, _L("Cancel"));
m_button_cancel->SetBackgroundColor(*wxWHITE);
m_button_cancel->SetBorderColor(wxColour(38, 46, 48));
m_button_cancel->SetFont(Label::Body_12);
m_button_cancel->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
sizer_button->Add(m_butto_ok, 0, wxALL, 5);
sizer_button->Add(m_button_cancel, 0, wxALL, 5);

View file

@ -226,17 +226,7 @@ MachineInfoPanel::MachineInfoPanel(wxWindow* parent, wxWindowID id, const wxPoin
m_main_right_sizer->Add(0, FromDIP(50), 0, wxEXPAND, FromDIP(5));
m_button_upgrade_firmware = new Button(this, _L("Update firmware"));
StateColor btn_bg(std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Disabled), std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Enabled),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor btn_bd(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Enabled));
StateColor btn_text(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Enabled));
m_button_upgrade_firmware->SetBackgroundColor(btn_bg);
m_button_upgrade_firmware->SetBorderColor(btn_bd);
m_button_upgrade_firmware->SetTextColor(btn_text);
m_button_upgrade_firmware->SetFont(Label::Body_10);
m_button_upgrade_firmware->SetMinSize(wxSize(FromDIP(-1), FromDIP(24)));
m_button_upgrade_firmware->SetCornerRadius(FromDIP(12));
m_button_upgrade_firmware->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_main_right_sizer->Add(m_button_upgrade_firmware, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, FromDIP(5));
m_staticText_upgrading_info = new wxStaticText(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, 0);
@ -1440,7 +1430,7 @@ void UpgradePanel::update(MachineObject *obj)
if (m_obj->upgrade_force_upgrade) {
m_show_forced_hint = false; //lock hint
if (force_dlg == nullptr) {
force_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Update firmware"), SecondaryCheckDialog::ButtonStyle::CONFIRM_AND_CANCEL, wxDefaultPosition, wxDefaultSize);
force_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Update firmware"), SecondaryCheckDialog::VisibleButtons::CONFIRM_AND_CANCEL, wxDefaultPosition, wxDefaultSize); // ORCA VisibleButtons instead ButtonStyle
force_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this](wxCommandEvent& e) {
if (m_obj) {
m_obj->command_upgrade_confirm();
@ -1465,7 +1455,7 @@ void UpgradePanel::update(MachineObject *obj)
if (m_obj->upgrade_consistency_request) {
m_show_consistency_hint = false;
if (consistency_dlg == nullptr) {
consistency_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Update firmware"), SecondaryCheckDialog::ButtonStyle::CONFIRM_AND_CANCEL, wxDefaultPosition, wxDefaultSize);
consistency_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Update firmware"), SecondaryCheckDialog::VisibleButtons::CONFIRM_AND_CANCEL, wxDefaultPosition, wxDefaultSize); // ORCA VisibleButtons instead ButtonStyle
consistency_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this](wxCommandEvent& e) {
if (m_obj) {
m_obj->command_consistency_upgrade_confirm();

View file

@ -133,37 +133,9 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
m_panel_option_right->SetMinSize(wxSize(FromDIP(180), -1));
m_panel_option_right->SetMaxSize(wxSize(FromDIP(180), -1));
StateColor btn_bg_green(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled),
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled),
std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Pressed),
std::pair<wxColour, int>(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_WHITE_COLOUR, StateColor::Normal));
StateColor btn_bd_green(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Disabled),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Enabled));
StateColor btn_bd_white(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
StateColor btn_text_green(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Enabled));
StateColor btn_text_white(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
/*option left*/
m_button_auto_refill = new Button(m_panel_option_left, _L("Auto-refill"));
m_button_auto_refill->SetBackgroundColor(btn_bg_white);
m_button_auto_refill->SetBorderColor(btn_bd_white);
m_button_auto_refill->SetTextColor(btn_text_white);
m_button_auto_refill->SetFont(Label::Body_13);
m_button_auto_refill->SetMinSize(wxSize(FromDIP(80), FromDIP(34)));
m_button_auto_refill->SetMaxSize(wxSize(FromDIP(80), FromDIP(34)));
m_button_auto_refill->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_ams_setting_normal = ScalableBitmap(this, "ams_setting_normal", 24);
m_button_ams_setting_hover = ScalableBitmap(this, "ams_setting_hover", 24);
@ -182,12 +154,7 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
/*option right*/
m_button_extruder_feed = new Button(m_panel_option_right, _L("Load"));
m_button_extruder_feed->SetFont(Label::Body_13);
m_button_extruder_feed->SetBackgroundColor(btn_bg_green);
m_button_extruder_feed->SetBorderColor(btn_bd_green);
m_button_extruder_feed->SetTextColor(btn_text_green);
m_button_extruder_feed->SetMinSize(wxSize(FromDIP(80),FromDIP(34)));
m_button_extruder_feed->SetMaxSize(wxSize(FromDIP(80),FromDIP(34)));
m_button_extruder_feed->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_extruder_feed->EnableTooltipEvenDisabled();
@ -203,12 +170,7 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
if (wxGetApp().app_config->get("language") == "pt_BR") m_button_extruder_feed->SetLabel("Load");
m_button_extruder_back = new Button(m_panel_option_right, _L("Unload"));
m_button_extruder_back->SetBackgroundColor(btn_bg_white);
m_button_extruder_back->SetBorderColor(btn_bd_white);
m_button_extruder_back->SetTextColor(btn_text_white);
m_button_extruder_back->SetFont(Label::Body_13);
m_button_extruder_back->SetMinSize(wxSize(FromDIP(80), FromDIP(34)));
m_button_extruder_back->SetMaxSize(wxSize(FromDIP(80), FromDIP(34)));
m_button_auto_refill->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_extruder_back->EnableTooltipEvenDisabled();
if (wxGetApp().app_config->get("language") == "de_DE") m_button_extruder_back->SetFont(Label::Body_9);
@ -502,12 +464,9 @@ void AMSControl::msw_rescale()
m_extruder->msw_rescale();
if (m_button_extruder_feed) m_button_extruder_feed->SetMinSize(wxSize(FromDIP(80), FromDIP(34)));
if (m_button_extruder_feed) m_button_extruder_feed->SetMaxSize(wxSize(FromDIP(80), FromDIP(34)));
if (m_button_extruder_back) m_button_extruder_back->SetMinSize(wxSize(FromDIP(80), FromDIP(34)));
if (m_button_extruder_back) m_button_extruder_back->SetMaxSize(wxSize(FromDIP(80), FromDIP(34)));
if (m_button_auto_refill) m_button_auto_refill->SetMinSize(wxSize(FromDIP(80), FromDIP(34)));
if (m_button_auto_refill) m_button_auto_refill->SetMaxSize(wxSize(FromDIP(80), FromDIP(34)));
if (m_button_extruder_feed) m_button_extruder_feed->Rescale(); // ORCA
if (m_button_extruder_back) m_button_extruder_back->Rescale(); // ORCA
if (m_button_auto_refill) m_button_auto_refill->Rescale(); // ORCA
if (m_button_ams_setting) m_button_ams_setting->SetMinSize(wxSize(FromDIP(25), FromDIP(24)));

View file

@ -2731,10 +2731,11 @@ void AMSPreview::doRender(wxDC &dc)
//single slot
else if (m_amsinfo.cans.size() == 1) {
auto iter = m_amsinfo.cans[0];
dc.SetPen(wxPen(*wxTRANSPARENT_PEN));
dc.SetBrush(StateColor::darkModeColorFor(AMS_CONTROL_DEF_BLOCK_BK_COLOUR));
wxSize rec_size = wxSize(FromDIP(16), FromDIP(24));
dc.DrawRoundedRectangle((size.x - rec_size.x) / 2, (size.y - rec_size.y) / 2, rec_size.x, rec_size.y, FromDIP(2));
// ORCA dont add additional background. four tray already doesnt use one
//dc.SetPen(wxPen(*wxTRANSPARENT_PEN));
//dc.SetBrush(StateColor::darkModeColorFor(AMS_CONTROL_DEF_BLOCK_BK_COLOUR));
//wxSize rec_size = wxSize(FromDIP(16), FromDIP(24));
//dc.DrawRoundedRectangle((size.x - rec_size.x) / 2, (size.y - rec_size.y) / 2, rec_size.x, rec_size.y, FromDIP(2));
if (iter.material_cols.size() > 1)
{
int fleft = (size.x - AMS_ITEM_CUBE_SIZE.x) / 2;

View file

@ -174,7 +174,7 @@ void Button::SetVertical(bool vertical)
// Background Foreground Border on focus
// Button Colors 0-Disabled 1-Pressed 2-Hover 3-Normal 4-Enabled 5-Disabled 6-Normal 7-Hover 8-Dark 9-Light
wxString btn_regular[10] = {"#DFDFDF", "#DFDFDF", "#D4D4D4", "#DFDFDF", "#DFDFDF", "#6B6A6A", "#262E30", "#262E30", "#009688", "#009688"};
wxString btn_confirm[10] = {"#DFDFDF", "#009688", "#26A69A", "#009688", "#009688", "#6B6A6A", "#FEFEFE", "#FEFEFE", "#26A69A", "#00FFD4"};
wxString btn_confirm[10] = {"#DFDFDF", "#009688", "#26A69A", "#009688", "#009688", "#6B6A6A", "#FEFEFE", "#FEFEFE", "#22bfb0", "#00FFD4"};
wxString btn_alert[10] = {"#DFDFDF", "#DFDFDF", "#E14747", "#DFDFDF", "#DFDFDF", "#6B6A6A", "#262E30", "#FFFFFD", "#009688", "#009688"};
wxString btn_disabled[10] = {"#DFDFDF", "#DFDFDF", "#DFDFDF", "#DFDFDF", "#DFDFDF", "#6B6A6A", "#6B6A6A", "#262E30", "#DFDFDF", "#DFDFDF"};
@ -220,19 +220,24 @@ void Button::SetStyle(const ButtonStyle style, const ButtonType type)
style == ButtonStyle::Disabled ? btn_disabled :
btn_regular ;
this->SetBackgroundColor(StateColor(
std::pair(wxColour(clr_arr[3]), (int)StateColor::NotHovered),
auto bg_color = StateColor(
std::pair(wxColour(clr_arr[0]), (int)StateColor::Disabled),
std::pair(wxColour(clr_arr[1]), (int)StateColor::Pressed),
std::pair(wxColour(clr_arr[2]), (int)StateColor::Hovered),
std::pair(wxColour(clr_arr[3]), (int)StateColor::Normal),
std::pair(wxColour(clr_arr[4]), (int)StateColor::Enabled)
));
this->SetBorderColor(StateColor(
std::pair(wxColour(clr_arr[3]), (int)StateColor::NotFocused),
);
bg_color.setTakeFocusedAsHovered(false);
this->SetBackgroundColor(bg_color);
wxColour focus_clr = clr_arr[is_dark ? 8 : 9];
auto border_color = StateColor(
std::pair(wxColour(clr_arr[0]), (int)StateColor::Disabled),
std::pair(wxColour(clr_arr[is_dark ? 8 : 9]), (int)StateColor::Focused)
));
std::pair(wxColour(clr_arr[2]), (int)(StateColor::Hovered | ~StateColor::Focused)),
std::pair(wxColour(focus_clr ), (int)StateColor::Focused),
std::pair(wxColour(clr_arr[3]), (int)StateColor::Normal)
);
border_color.setTakeFocusedAsHovered(false);
this->SetBorderColor(border_color);
this->SetTextColor(StateColor(
std::pair(wxColour(clr_arr[5]), (int)StateColor::Disabled),
std::pair(wxColour(clr_arr[7]), (int)StateColor::Hovered),

View file

@ -5,13 +5,14 @@
namespace Slic3r { namespace GUI {
// ORCA standardize dialog buttons
DialogButtons::DialogButtons(wxWindow* parent, std::vector<wxString> non_translated_labels, const wxString& primary_btn_translated_label)
DialogButtons::DialogButtons(wxWindow* parent, std::vector<wxString> non_translated_labels, const wxString& primary_btn_translated_label, const int left_aligned_buttons_count)
: wxPanel(parent, wxID_ANY)
{
m_parent = parent;
m_sizer = new wxBoxSizer(wxHORIZONTAL);
m_primary = primary_btn_translated_label;
m_alert = wxEmptyString;
m_left_aligned_buttons_count = left_aligned_buttons_count;
SetBackgroundColour(StateColor::darkModeColorFor(wxColour("#FFFFFF")));
// Add all to array
@ -55,6 +56,13 @@ Button* DialogButtons::GetButtonFromLabel(wxString translated_label) {
return nullptr;
}
Button* DialogButtons::GetButtonFromIndex(int index) {
if(index >= 0 && index < m_buttons.size())
return m_buttons[index];
else
return nullptr;
}
Button* DialogButtons::PickFromList(std::set<wxStandardID> ID_list) {
// Picks first button from given list
Button* b;
@ -75,6 +83,8 @@ Button* DialogButtons::GetNO() {return GetButtonFromID(wxID_NO) ;}
Button* DialogButtons::GetCANCEL() {return GetButtonFromID(wxID_CANCEL) ;}
Button* DialogButtons::GetRETURN() {return GetButtonFromID(wxID_BACKWARD);} // gets Return button
Button* DialogButtons::GetNEXT() {return GetButtonFromID(wxID_FORWARD) ;}
Button* DialogButtons::GetFIRST() {return GetButtonFromIndex(0) ;}
Button* DialogButtons::GetLAST() {return GetButtonFromIndex(m_buttons.size() - 1);}
void DialogButtons::SetPrimaryButton(wxString translated_label) {
// use _L("Create") translated text for custom buttons
@ -127,25 +137,18 @@ void DialogButtons::UpdateButtons() {
btn->Bind(wxEVT_KEY_DOWN, &DialogButtons::on_keydown, this);
}
int btn_gap = FromDIP(10);
int btn_gap = FromDIP(ButtonProps::ChoiceButtonGap());
auto list = m_left_align_IDs;
auto on_left = [list](int id){
return list.find(wxStandardID(id)) != list.end();
};
for (Button* btn : m_buttons) // Left aligned
if(on_left(btn->GetId()))
m_sizer->Add(btn, 0, wxLEFT | wxTOP | wxBOTTOM | wxALIGN_CENTER_VERTICAL, btn_gap);
m_sizer->AddStretchSpacer();
if(m_sizer->IsEmpty()) // add left margin if no button on left. fixes no gap on small windows
if(m_left_aligned_buttons_count == 0)
m_sizer->AddSpacer(btn_gap);
for (Button* btn : m_buttons) // Right aligned
if(!on_left(btn->GetId()))
m_sizer->Add(btn, 0, wxRIGHT | wxTOP | wxBOTTOM | wxALIGN_CENTER_VERTICAL, btn_gap);
for (int i = 0; i < m_buttons.size(); i++) {
if(m_left_aligned_buttons_count == i)
m_sizer->AddStretchSpacer();
auto margin_to = (i >= m_left_aligned_buttons_count ? wxRIGHT : wxLEFT);
m_sizer->Add(m_buttons[i], 0, margin_to | wxTOP | wxBOTTOM | wxALIGN_CENTER_VERTICAL, btn_gap);
}
SetPrimaryButton(m_primary);
SetAlertButton(m_alert);
@ -158,6 +161,11 @@ int DialogButtons::FromDIP(int d) {
return m_parent->FromDIP(d);
}
void DialogButtons::SetLeftAlignedButtonsCount(int left_aligned_buttons_count){
m_left_aligned_buttons_count = left_aligned_buttons_count;
UpdateButtons();
}
// This might be helpful for future use
// Append Button

View file

@ -16,7 +16,7 @@ namespace Slic3r { namespace GUI {
class DialogButtons : public wxPanel{
public:
DialogButtons(wxWindow* parent, std::vector<wxString> non_translated_labels, const wxString& primary_btn_label = "");
DialogButtons(wxWindow* parent, std::vector<wxString> non_translated_labels, const wxString& primary_btn_label = "", const int left_aligned_buttons_count = 0);
wxBoxSizer* GetSizer() const { return m_sizer; }
@ -24,6 +24,8 @@ public:
Button* GetButtonFromLabel(wxString label);
Button* GetButtonFromIndex(int index);
Button* GetOK();
Button* GetYES();
Button* GetAPPLY();
@ -32,11 +34,15 @@ public:
Button* GetCANCEL();
Button* GetRETURN();
Button* GetNEXT();
Button* GetFIRST();
Button* GetLAST();
void SetPrimaryButton(wxString label);
void SetAlertButton(wxString label);
void SetLeftAlignedButtonsCount(int left_aligned_buttons_count);
void UpdateButtons();
~DialogButtons();
@ -47,6 +53,7 @@ private:
std::vector<Button*> m_buttons;
wxString m_primary;
wxString m_alert;
int m_left_aligned_buttons_count;
// missing ones Transfer / Update / Create
const std::map<wxString, wxStandardID> m_standardIDs = {
@ -106,12 +113,6 @@ private:
wxID_EXIT
};
std::set<wxStandardID> m_left_align_IDs {
wxID_DELETE,
wxID_BACKWARD,
wxID_FORWARD
};
Button* PickFromList(std::set<wxStandardID> ID_list);
int FromDIP(int d);

View file

@ -14,6 +14,7 @@ static std::map<wxColour, wxColour> gDarkColors{
{"#DFDFDF", "#3E3E45"}, // rgb(223, 223, 223) Button Background color
{"#D4D4D4", "#4D4D54"}, // rgb(212, 212, 212) Button Background color on Hover
{"#6B6A6A", "#909090"}, // rgb(107, 107, 106) Button Dimmed text
{"#26A69A", "#008172"}, // rgb(0, 150, 136) Button Confirm Color hover | ORCA Color Hover
{"#6B6B6A", "#B3B3B5"}, // rgb(107, 107, 106) Input box side text
{"#2C2C2E", "#B3B3B4"}, // rgb(44, 44, 46) ???
{"#6B6B6B", "#818183"}, // rgb(107, 107, 107) Disabled Text

View file

@ -284,6 +284,19 @@ void PA_Calibration_Dlg::on_start(wxCommandEvent& event) {
ParseStringValues(m_tiBMAccels->GetTextCtrl()->GetValue().ToStdString(), m_params.accelerations);
ParseStringValues(m_tiBMSpeeds->GetTextCtrl()->GetValue().ToStdString(), m_params.speeds);
if (!m_params.accelerations.empty() && !m_params.speeds.empty()) {
// Guard against swapped inputs by ensuring acceleration magnitudes exceed speeds.
const double min_accel = *std::min_element(m_params.accelerations.begin(), m_params.accelerations.end());
const double max_speed = *std::max_element(m_params.speeds.begin(), m_params.speeds.end());
if (min_accel <= max_speed) {
MessageDialog msg_dlg(nullptr,
_L("Acceleration values must be greater than speed values.\nPlease verify the inputs."),
wxEmptyString, wxICON_WARNING | wxOK);
msg_dlg.ShowModal();
return;
}
}
m_plater->calib_pa(m_params);
EndModal(wxID_OK);