Fix some bugs

This commit is contained in:
sunsets
2024-01-03 15:39:59 +08:00
parent c6f7bed17e
commit 8a3b753bb1
7 changed files with 50 additions and 40 deletions

View File

@@ -1643,7 +1643,7 @@ PageReloadFromDisk::PageReloadFromDisk(ConfigWizard* parent)
PageFilesAssociation::PageFilesAssociation(ConfigWizard* parent)
: ConfigWizardPage(parent, _L("Files association"), _L("Files association"))
{
//Y
//Y //B47
cb_3mf = new wxCheckBox(this, wxID_ANY, _L("Associate .3mf files to QIDISlicer"));
cb_stl = new wxCheckBox(this, wxID_ANY, _L("Associate .stl files to QIDISlicer"));
cb_step = new wxCheckBox(this, wxID_ANY, _L("Associate .step/.stp files to QIDISlicer"));
@@ -1651,6 +1651,7 @@ PageFilesAssociation::PageFilesAssociation(ConfigWizard* parent)
append(cb_3mf);
append(cb_stl);
append(cb_step);
// append(cb_gcode);
}
#endif // _WIN32

View File

@@ -7862,6 +7862,7 @@ void GLCanvas3D::GizmoHighlighter::blink()
invalidate();
}
//B48
#if ENABLE_BINARIZED_GCODE_DEBUG_WINDOW
void GLCanvas3D::show_binary_gcode_debug_window()
{
@@ -7875,7 +7876,7 @@ void GLCanvas3D::show_binary_gcode_debug_window()
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
imgui.text_colored(ImGuiWrapper::COL_ORANGE_LIGHT, "File metadata compression");
imgui.text_colored(ImGuiWrapper::COL_BLUE_LIGHT, "File metadata compression");
ImGui::TableSetColumnIndex(1);
std::vector<std::string> options = { "None", "Deflate", "heatshrink 11,4", "heatshrink 12,4" };
int option_id = (int)binarizer_config.compression.file_metadata;
@@ -7884,7 +7885,7 @@ void GLCanvas3D::show_binary_gcode_debug_window()
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
imgui.text_colored(ImGuiWrapper::COL_ORANGE_LIGHT, "Printer metadata compression");
imgui.text_colored(ImGuiWrapper::COL_BLUE_LIGHT, "Printer metadata compression");
ImGui::TableSetColumnIndex(1);
option_id = (int)binarizer_config.compression.printer_metadata;
if (imgui.combo(std::string("##printer_metadata_compression"), options, option_id, ImGuiComboFlags_HeightLargest, 0.0f, 175.0f))
@@ -7892,7 +7893,7 @@ void GLCanvas3D::show_binary_gcode_debug_window()
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
imgui.text_colored(ImGuiWrapper::COL_ORANGE_LIGHT, "Print metadata compression");
imgui.text_colored(ImGuiWrapper::COL_BLUE_LIGHT, "Print metadata compression");
ImGui::TableSetColumnIndex(1);
option_id = (int)binarizer_config.compression.print_metadata;
if (imgui.combo(std::string("##print_metadata_compression"), options, option_id, ImGuiComboFlags_HeightLargest, 0.0f, 175.0f))
@@ -7900,7 +7901,7 @@ void GLCanvas3D::show_binary_gcode_debug_window()
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
imgui.text_colored(ImGuiWrapper::COL_ORANGE_LIGHT, "Slicer metadata compression");
imgui.text_colored(ImGuiWrapper::COL_BLUE_LIGHT, "Slicer metadata compression");
ImGui::TableSetColumnIndex(1);
option_id = (int)binarizer_config.compression.slicer_metadata;
if (imgui.combo(std::string("##slicer_metadata_compression"), options, option_id, ImGuiComboFlags_HeightLargest, 0.0f, 175.0f))
@@ -7908,7 +7909,7 @@ void GLCanvas3D::show_binary_gcode_debug_window()
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
imgui.text_colored(ImGuiWrapper::COL_ORANGE_LIGHT, "GCode compression");
imgui.text_colored(ImGuiWrapper::COL_BLUE_LIGHT, "GCode compression");
ImGui::TableSetColumnIndex(1);
option_id = (int)binarizer_config.compression.gcode;
if (imgui.combo(std::string("##gcode_compression"), options, option_id, ImGuiComboFlags_HeightLargest, 0.0f, 175.0f))
@@ -7916,7 +7917,7 @@ void GLCanvas3D::show_binary_gcode_debug_window()
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
imgui.text_colored(ImGuiWrapper::COL_ORANGE_LIGHT, "GCode encoding");
imgui.text_colored(ImGuiWrapper::COL_BLUE_LIGHT, "GCode encoding");
ImGui::TableSetColumnIndex(1);
options = { "None", "MeatPack", "MeatPack Comments" };
option_id = (int)binarizer_config.gcode_encoding;
@@ -7925,7 +7926,7 @@ void GLCanvas3D::show_binary_gcode_debug_window()
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
imgui.text_colored(ImGuiWrapper::COL_ORANGE_LIGHT, "Metadata encoding");
imgui.text_colored(ImGuiWrapper::COL_BLUE_LIGHT, "Metadata encoding");
ImGui::TableSetColumnIndex(1);
options = { "INI" };
option_id = (int)binarizer_config.metadata_encoding;
@@ -7934,7 +7935,7 @@ void GLCanvas3D::show_binary_gcode_debug_window()
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
imgui.text_colored(ImGuiWrapper::COL_ORANGE_LIGHT, "Checksum type");
imgui.text_colored(ImGuiWrapper::COL_BLUE_LIGHT, "Checksum type");
ImGui::TableSetColumnIndex(1);
options = { "None", "CRC32" };
option_id = (int)binarizer_config.checksum;

View File

@@ -70,8 +70,9 @@ MsgDialog::MsgDialog(wxWindow *parent, const wxString &title, const wxString &he
main_sizer->Add(topsizer, 1, wxEXPAND);
main_sizer->Add(new StaticLine(this), 0, wxEXPAND | wxLEFT | wxRIGHT, HORIZ_SPACING);
main_sizer->Add(btn_sizer, 0, wxALL | wxEXPAND, VERT_SPACING);
if (style & wxOK)
add_button(wxID_OK, true);
//B50
// if (style & wxOK)
// add_button(wxID_OK, true);
if (title != "App Update available") {
apply_style(style);
}

View File

@@ -387,11 +387,14 @@ void SpinInput::onTextLostFocus(wxEvent &event)
event.Skip();
}
//B49
void SpinInput::onTextEnter(wxCommandEvent &event)
{
long value;
if (!text_ctrl->GetValue().ToLong(&value))
if (!text_ctrl->GetValue().ToLong(&value)) {
value = val;
text_ctrl->SetValue(wxString::FromDouble(value));
}
if (value != val) {
SetValue(value);
@@ -584,12 +587,16 @@ void SpinInputDouble::onTextLostFocus(wxEvent &event)
event.Skip();
}
//B49
void SpinInputDouble::onTextEnter(wxCommandEvent &event)
{
double value;
if (!text_ctrl->GetValue().ToDouble(&value))
if (!text_ctrl->GetValue().ToDouble(&value)) {
val = value;
wxString str_val = wxString::FromDouble(value, digits);
text_ctrl->SetValue(str_val);
}
if (!Slic3r::is_approx(value, val)) {
SetValue(value);
sendSpinEvent();

View File

@@ -1,8 +1,9 @@
#ifndef slic3r_UI_Colors_hpp_
#define slic3r_UI_Colors_hpp_
//B48
static const int clr_border_normal = 0x646464;//0xDBDBDB;
static const int clr_border_hovered = 0xED6B21;//0x00AE42;
static const int clr_border_hovered = 0x4479FB;//0x00AE42;
static const int clr_border_disabled = 0x646464;//0xDBDBDB;
static const int clr_background_normal_light = 0xFFFFFF;