FIX: linux darkmode text display

Change-Id: I2c935647669dd9743cf4a230ef21e48ea4b92eb8
This commit is contained in:
liz.li 2023-07-20 11:10:45 +08:00 committed by Lane.Wei
parent 59b6b59a9a
commit 4d8ad0003b
17 changed files with 249 additions and 115 deletions

View file

@ -1,3 +1,3 @@
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.58579 18.5858C3.80474 19.3668 3.80474 20.6332 4.58579 21.4142L17.3137 34.1421C18.0948 34.9232 19.3611 34.9232 20.1421 34.1421C20.9232 33.3611 20.9232 32.0948 20.1421 31.3137L8.82843 20L20.1421 8.68629C20.9232 7.90524 20.9232 6.63891 20.1421 5.85786C19.3611 5.07682 18.0948 5.07682 17.3137 5.85786L4.58579 18.5858ZM34.5 18H6V22H34.5V18Z" fill="black"/>
<path d="M4.58579 18.5858C3.80474 19.3668 3.80474 20.6332 4.58579 21.4142L17.3137 34.1421C18.0948 34.9232 19.3611 34.9232 20.1421 34.1421C20.9232 33.3611 20.9232 32.0948 20.1421 31.3137L8.82843 20L20.1421 8.68629C20.9232 7.90524 20.9232 6.63891 20.1421 5.85786C19.3611 5.07682 18.0948 5.07682 17.3137 5.85786L4.58579 18.5858ZM34.5 18H6V22H34.5V18Z" fill="#262E30"/>
</svg>

Before

Width:  |  Height:  |  Size: 467 B

After

Width:  |  Height:  |  Size: 469 B

View file

@ -1,3 +1,3 @@
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.58579 18.5858C3.80474 19.3668 3.80474 20.6332 4.58579 21.4142L17.3137 34.1421C18.0948 34.9232 19.3611 34.9232 20.1421 34.1421C20.9232 33.3611 20.9232 32.0948 20.1421 31.3137L8.82843 20L20.1421 8.68629C20.9232 7.90524 20.9232 6.63891 20.1421 5.85786C19.3611 5.07682 18.0948 5.07682 17.3137 5.85786L4.58579 18.5858ZM34.5 18H6V22H34.5V18Z" fill="black"/>
<path d="M4.58579 18.5858C3.80474 19.3668 3.80474 20.6332 4.58579 21.4142L17.3137 34.1421C18.0948 34.9232 19.3611 34.9232 20.1421 34.1421C20.9232 33.3611 20.9232 32.0948 20.1421 31.3137L8.82843 20L20.1421 8.68629C20.9232 7.90524 20.9232 6.63891 20.1421 5.85786C19.3611 5.07682 18.0948 5.07682 17.3137 5.85786L4.58579 18.5858ZM34.5 18H6V22H34.5V18Z" fill="#262E30"/>
</svg>

Before

Width:  |  Height:  |  Size: 467 B

After

Width:  |  Height:  |  Size: 469 B

View file

@ -61,7 +61,7 @@ HistoryWindow::HistoryWindow(wxWindow* parent, const std::vector<PACalibResult>&
comboBox_panel->SetSizer(comboBox_sizer);
comboBox_sizer->AddSpacer(10);
auto nozzle_dia_title = new wxStaticText(comboBox_panel, wxID_ANY, _L("Nozzle Diameter"));
auto nozzle_dia_title = new Label(comboBox_panel, _L("Nozzle Diameter"));
nozzle_dia_title->SetFont(Label::Head_14);
comboBox_sizer->Add(nozzle_dia_title, 0, wxLEFT | wxRIGHT, FromDIP(15));
comboBox_sizer->AddSpacer(10);
@ -75,9 +75,10 @@ HistoryWindow::HistoryWindow(wxWindow* parent, const std::vector<PACalibResult>&
scroll_sizer->AddSpacer(FromDIP(15));
wxPanel* tips_panel = new wxPanel(scroll_window, wxID_ANY);
tips_panel->SetBackgroundColour(*wxWHITE);
auto tips_sizer = new wxBoxSizer(wxVERTICAL);
tips_panel->SetSizer(tips_sizer);
m_tips = new wxStaticText(tips_panel, wxID_ANY, "");
m_tips = new Label(tips_panel, "");
m_tips->SetForegroundColour({ 145, 145, 145 });
tips_sizer->Add(m_tips, 0, wxEXPAND);
@ -86,6 +87,7 @@ HistoryWindow::HistoryWindow(wxWindow* parent, const std::vector<PACalibResult>&
scroll_sizer->AddSpacer(FromDIP(15));
m_history_data_panel = new wxPanel(scroll_window);
m_history_data_panel->SetBackgroundColour(*wxWHITE);
scroll_sizer->Add(m_history_data_panel, 1, wxEXPAND);
@ -208,38 +210,38 @@ void HistoryWindow::sync_history_data() {
m_history_data_panel->SetSizer(gbSizer, true);
auto title_name = new wxStaticText(m_history_data_panel, wxID_ANY, _L("Name"));
auto title_name = new Label(m_history_data_panel, _L("Name"));
title_name->SetFont(Label::Head_14);
gbSizer->Add(title_name, { 0, 0 }, { 1, 1 }, wxBOTTOM, FromDIP(15));
auto title_preset_name = new wxStaticText(m_history_data_panel, wxID_ANY, _L("Filament"));
auto title_preset_name = new Label(m_history_data_panel, _L("Filament"));
title_preset_name->SetFont(Label::Head_14);
gbSizer->Add(title_preset_name, { 0, 1 }, { 1, 1 }, wxBOTTOM, FromDIP(15));
auto title_k = new wxStaticText(m_history_data_panel, wxID_ANY, _L("Factor K"));
auto title_k = new Label(m_history_data_panel, _L("Factor K"));
title_k->SetFont(Label::Head_14);
gbSizer->Add(title_k, { 0, 2 }, { 1, 1 }, wxBOTTOM, FromDIP(15));
// Hide
//auto title_n = new wxStaticText(m_history_data_panel, wxID_ANY, _L("N"));
//auto title_n = new Label(m_history_data_panel, wxID_ANY, _L("N"));
//title_n->SetFont(Label::Head_14);
//gbSizer->Add(title_n, { 0, 3 }, { 1, 1 }, wxBOTTOM, FromDIP(15));
auto title_action = new wxStaticText(m_history_data_panel, wxID_ANY, _L("Action"));
auto title_action = new Label(m_history_data_panel, _L("Action"));
title_action->SetFont(Label::Head_14);
gbSizer->Add(title_action, { 0, 3 }, { 1, 1 });
int i = 1;
for (auto& result : m_calib_results_history) {
auto name_value = new wxStaticText(m_history_data_panel, wxID_ANY, from_u8(result.name));
auto name_value = new Label(m_history_data_panel, from_u8(result.name));
wxString preset_name = get_preset_name_by_filament_id(result.filament_id);
auto preset_name_value = new wxStaticText(m_history_data_panel, wxID_ANY, preset_name);
auto preset_name_value = new Label(m_history_data_panel, preset_name);
auto k_str = wxString::Format("%.3f", result.k_value);
auto n_str = wxString::Format("%.3f", result.n_coef);
auto k_value = new wxStaticText(m_history_data_panel, wxID_ANY, k_str);
auto n_value = new wxStaticText(m_history_data_panel, wxID_ANY, n_str);
auto k_value = new Label(m_history_data_panel, k_str);
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);
@ -292,6 +294,8 @@ void HistoryWindow::sync_history_data() {
i++;
}
wxGetApp().UpdateDlgDarkUI(this);
m_history_data_panel->Layout();
m_history_data_panel->Thaw();
}
@ -319,6 +323,7 @@ EditCalibrationHistoryDialog::EditCalibrationHistoryDialog(wxWindow* parent, con
auto main_sizer = new wxBoxSizer(wxVERTICAL);
auto top_panel = new wxPanel(this);
top_panel->SetBackgroundColour(*wxWHITE);
auto panel_sizer = new wxBoxSizer(wxVERTICAL);
top_panel->SetSizer(panel_sizer);
@ -326,7 +331,7 @@ EditCalibrationHistoryDialog::EditCalibrationHistoryDialog(wxWindow* parent, con
flex_sizer->SetFlexibleDirection(wxBOTH);
flex_sizer->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
wxStaticText* name_title = new wxStaticText(top_panel, wxID_ANY, _L("Name"));
Label* name_title = new Label(top_panel, _L("Name"));
TextInput* name_value = new TextInput(top_panel, m_new_result.name, "", "", wxDefaultPosition, EDIT_HISTORY_DIALOG_INPUT_SIZE, wxTE_PROCESS_ENTER);
name_value->GetTextCtrl()->Bind(wxEVT_TEXT_ENTER, [this, name_value](auto& e) {
if (!name_value->GetTextCtrl()->GetValue().IsEmpty())
@ -340,13 +345,13 @@ EditCalibrationHistoryDialog::EditCalibrationHistoryDialog(wxWindow* parent, con
flex_sizer->Add(name_title);
flex_sizer->Add(name_value);
wxStaticText* preset_name_title = new wxStaticText(top_panel, wxID_ANY, _L("Filament"));
Label* preset_name_title = new Label(top_panel, _L("Filament"));
wxString preset_name = get_preset_name_by_filament_id(result.filament_id);
wxStaticText* preset_name_value = new wxStaticText(top_panel, wxID_ANY, preset_name);
Label* preset_name_value = new Label(top_panel, preset_name);
flex_sizer->Add(preset_name_title);
flex_sizer->Add(preset_name_value);
wxStaticText* k_title = new wxStaticText(top_panel, wxID_ANY, _L("Factor K"));
Label* k_title = new Label(top_panel, _L("Factor K"));
auto k_str = wxString::Format("%.3f", m_new_result.k_value);
TextInput* k_value = new TextInput(top_panel, k_str, "", "", wxDefaultPosition, EDIT_HISTORY_DIALOG_INPUT_SIZE, wxTE_PROCESS_ENTER);
k_value->GetTextCtrl()->Bind(wxEVT_TEXT_ENTER, [this, k_value](auto& e) {
@ -374,7 +379,7 @@ EditCalibrationHistoryDialog::EditCalibrationHistoryDialog(wxWindow* parent, con
flex_sizer->Add(k_value);
// Hide:
//wxStaticText* n_title = new wxStaticText(top_panel, wxID_ANY, _L("Factor N"));
//Label* n_title = new Label(top_panel, _L("Factor N"));
//TextInput* n_value = new TextInput(top_panel, n, "", "", wxDefaultPosition, EDIT_HISTORY_DIALOG_INPUT_SIZE, wxTE_PROCESS_ENTER);
//flex_sizer->Add(n_title);
//flex_sizer->Add(n_value);

View file

@ -26,7 +26,7 @@ protected:
wxPanel* m_history_data_panel;
ComboBox* m_comboBox_nozzle_dia;
wxStaticText* m_tips;
Label* m_tips;
wxTimer* m_refresh_timer { nullptr };

View file

@ -703,6 +703,20 @@ void CalibrationPanel::set_default()
wxGetApp().sidebar().load_ams_list({}, {});
}
void CalibrationPanel::msw_rescale()
{
for (int i = 0; i < (int)CALI_MODE_COUNT; i++) {
m_cali_panels[i]->msw_rescale();
}
}
void CalibrationPanel::on_sys_color_changed()
{
for (int i = 0; i < (int)CALI_MODE_COUNT; i++) {
m_cali_panels[i]->on_sys_color_changed();
}
}
CalibrationPanel::~CalibrationPanel() {
m_side_tools->get_panel()->Disconnect(wxEVT_LEFT_DOWN, wxMouseEventHandler(CalibrationPanel::on_printer_clicked), NULL, this);
if (m_refresh_timer)

View file

@ -111,6 +111,8 @@ public:
bool Show(bool show);
void on_printer_clicked(wxMouseEvent& event);
void set_default();
void msw_rescale();
void on_sys_color_changed();
protected:
void init_tabpanel();
void init_timer();

View file

@ -275,6 +275,22 @@ void CalibrationWizard::back_preset_info(MachineObject *obj, bool cali_finish)
wxGetApp().app_config->save_printer_cali_infos(printer_cali_info);
}
void CalibrationWizard::msw_rescale()
{
for (int i = 0; i < m_page_steps.size(); i++) {
if (m_page_steps[i]->page)
m_page_steps[i]->page->msw_rescale();
}
}
void CalibrationWizard::on_sys_color_changed()
{
for (int i = 0; i < m_page_steps.size(); i++) {
if (m_page_steps[i]->page)
m_page_steps[i]->page->on_sys_color_changed();
}
}
void CalibrationWizard::on_cali_go_home()
{
// can go home? confirm to continue

View file

@ -66,6 +66,9 @@ public:
virtual void recover_preset_info(MachineObject *obj);
virtual void back_preset_info(MachineObject *obj, bool cali_finish);
void msw_rescale();
void on_sys_color_changed();
protected:
void on_cali_go_home();

View file

@ -351,6 +351,8 @@ CaliPageCaption::CaliPageCaption(wxWindow* parent, CalibMode cali_mode,
{
init_bitmaps();
SetBackgroundColour(*wxWHITE);
auto top_sizer = new wxBoxSizer(wxVERTICAL);
auto caption_sizer = new wxBoxSizer(wxHORIZONTAL);
m_prev_btn = new ScalableButton(this, wxID_ANY, "cali_page_caption_prev",
@ -359,7 +361,7 @@ CaliPageCaption::CaliPageCaption(wxWindow* parent, CalibMode cali_mode,
caption_sizer->Add(m_prev_btn, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(10));
wxString title = get_cali_mode_caption_string(cali_mode);
wxStaticText* title_text = new wxStaticText(this, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, 0);
Label* title_text = new Label(this, title);
title_text->SetFont(Label::Head_20);
title_text->Wrap(-1);
caption_sizer->Add(title_text, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(10));
@ -391,13 +393,13 @@ CaliPageCaption::CaliPageCaption(wxWindow* parent, CalibMode cali_mode,
});
// hover effect
m_help_btn->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {
m_help_btn->SetBitmap(m_help_bmp_hover.bmp());
});
//m_help_btn->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {
// m_help_btn->SetBitmap(m_help_bmp_hover.bmp());
// });
m_help_btn->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {
m_help_btn->SetBitmap(m_help_bmp_normal.bmp());
});
//m_help_btn->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {
// m_help_btn->SetBitmap(m_help_bmp_normal.bmp());
// });
// send event
m_prev_btn->Bind(wxEVT_BUTTON, [this](auto& e) {
@ -406,6 +408,14 @@ CaliPageCaption::CaliPageCaption(wxWindow* parent, CalibMode cali_mode,
event.SetInt((int)(CaliPageActionType::CALI_ACTION_GO_HOME));
wxPostEvent(m_parent, event);
});
#ifdef __linux__
wxGetApp().CallAfter([this, title_text]() {
title_text->SetMinSize(title_text->GetSize() + wxSize{ FromDIP(150), title_text->GetCharHeight() / 2 });
Layout();
Fit();
});
#endif
}
void CaliPageCaption::init_bitmaps() {
@ -417,7 +427,7 @@ void CaliPageCaption::init_bitmaps() {
void CaliPageCaption::create_wiki(wxWindow* parent)
{
m_wiki_text = new wxStaticText(parent, wxID_ANY, _L("Wiki"));
m_wiki_text = new Label(parent, _L("Wiki"));
m_wiki_text->SetFont(Label::Head_14);
m_wiki_text->SetForegroundColour({ 0, 88, 220 });
m_wiki_text->Bind(wxEVT_ENTER_WINDOW, [this](wxMouseEvent& e) {
@ -445,18 +455,25 @@ void CaliPageCaption::show_help_icon(bool show)
m_help_btn->Hide();
}
void CaliPageCaption::on_sys_color_changed()
{
m_prev_btn->msw_rescale();
}
CaliPageStepGuide::CaliPageStepGuide(wxWindow* parent, wxArrayString steps,
wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
: wxPanel(parent, id, pos, size, style),
m_steps(steps)
{
SetBackgroundColour(*wxWHITE);
auto top_sizer = new wxBoxSizer(wxVERTICAL);
m_step_sizer = new wxBoxSizer(wxHORIZONTAL);
m_step_sizer->AddSpacer(FromDIP(90));
for (int i = 0; i < m_steps.size(); i++) {
wxStaticText* step_text = new wxStaticText(this, wxID_ANY, m_steps[i]);
step_text->SetForegroundColour(wxColour(181, 181, 181));
Label* step_text = new Label(this, m_steps[i]);
step_text->SetForegroundColour(wxColour(206, 206, 206));
m_text_steps.push_back(step_text);
m_step_sizer->Add(step_text, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, FromDIP(15));
if (i != m_steps.size() - 1) {
@ -471,14 +488,18 @@ CaliPageStepGuide::CaliPageStepGuide(wxWindow* parent, wxArrayString steps,
top_sizer->AddSpacer(FromDIP(30));
this->SetSizer(top_sizer);
top_sizer->Fit(this);
wxGetApp().UpdateDarkUIWin(this);
}
void CaliPageStepGuide::set_steps(int index)
{
for (wxStaticText* text_step : m_text_steps) {
text_step->SetForegroundColour(wxColour(181, 181, 181));
for (Label* text_step : m_text_steps) {
text_step->SetForegroundColour(wxColour(206, 206, 206));
}
m_text_steps[index]->SetForegroundColour(*wxBLACK);
wxGetApp().UpdateDarkUIWin(this);
}
void CaliPageStepGuide::set_steps_string(wxArrayString steps)
@ -489,8 +510,8 @@ void CaliPageStepGuide::set_steps_string(wxArrayString steps)
m_steps = steps;
m_step_sizer->AddSpacer(FromDIP(90));
for (int i = 0; i < m_steps.size(); i++) {
wxStaticText* step_text = new wxStaticText(this, wxID_ANY, m_steps[i]);
step_text->SetForegroundColour(wxColour(181, 181, 181));
Label* step_text = new Label(this, m_steps[i]);
step_text->SetForegroundColour(wxColour(206, 206, 206));
m_text_steps.push_back(step_text);
m_step_sizer->Add(step_text, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, FromDIP(15));
if (i != m_steps.size() - 1) {
@ -500,6 +521,9 @@ void CaliPageStepGuide::set_steps_string(wxArrayString steps)
}
}
m_step_sizer->AddSpacer(FromDIP(90));
wxGetApp().UpdateDarkUIWin(this);
Layout();
}
@ -535,12 +559,12 @@ PAPageHelpPanel::PAPageHelpPanel(wxWindow* parent, bool ground_panel, wxWindowID
wxBoxSizer* top_sizer = new wxBoxSizer(wxVERTICAL);
top_sizer->AddSpacer(FromDIP(10));
auto help_text_title = new wxStaticText(this, wxID_ANY, _L("How to use calibration result?"));
auto help_text_title = new Label(this, _L("How to use calibration result?"));
help_text_title->SetFont(Label::Head_14);
top_sizer->Add(help_text_title, 0, wxLEFT | wxRIGHT, left_align_padding);
wxBoxSizer* help_text_sizer = new wxBoxSizer(wxHORIZONTAL);
auto help_text = new wxStaticText(this, wxID_ANY, _L("You could change the Flow Dynamics Calibration Factor in material editing"));
auto help_text = new Label(this, _L("You could change the Flow Dynamics Calibration Factor in material editing"));
help_text->SetFont(Label::Body_14);
m_help_btn = new ScalableButton(this, wxID_ANY, "cali_page_caption_help", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, false, 24);
m_help_btn->SetBackgroundColour(m_help_btn->GetParent()->GetBackgroundColour());
@ -734,5 +758,13 @@ CalibrationWizardPage::CalibrationWizardPage(wxWindow* parent, wxWindowID id, co
SetMinSize({ MIN_CALIBRATION_PAGE_WIDTH, -1 });
}
void CalibrationWizardPage::msw_rescale()
{
}
void CalibrationWizardPage::on_sys_color_changed()
{
m_page_caption->on_sys_color_changed();
}
}}

View file

@ -122,6 +122,7 @@ public:
void show_prev_btn(bool show = true);
void show_help_icon(bool show = true);
void on_sys_color_changed();
protected:
ScalableButton* m_prev_btn;
@ -131,7 +132,7 @@ private:
void init_bitmaps();
void create_wiki(wxWindow* parent);
wxStaticText* m_wiki_text;
Label* m_wiki_text;
wxString m_wiki_url;
ScalableBitmap m_prev_bmp_normal;
ScalableBitmap m_prev_bmp_hover;
@ -154,7 +155,7 @@ public:
protected:
wxArrayString m_steps;
wxBoxSizer* m_step_sizer;
std::vector<wxStaticText*> m_text_steps;
std::vector<Label*> m_text_steps;
};
class CaliPagePicture : public wxPanel
@ -276,6 +277,9 @@ public:
}
}
void msw_rescale();
void on_sys_color_changed();
protected:
CalibMode m_cali_mode;
CaliPageType m_page_type;
@ -286,7 +290,7 @@ protected:
wxWindow* m_parent { nullptr };
CaliPageCaption* m_page_caption { nullptr };
CaliPageActionPanel* m_action_panel { nullptr };
wxStaticText* m_statictext_printer_msg{ nullptr };
Label* m_statictext_printer_msg{ nullptr };
private:
CalibrationWizardPage* m_prev_page {nullptr};

View file

@ -20,6 +20,8 @@ CaliPresetCaliStagePanel::CaliPresetCaliStagePanel(
long style)
: wxPanel(parent, id, pos, size, style)
{
SetBackgroundColour(*wxWHITE);
m_top_sizer = new wxBoxSizer(wxVERTICAL);
create_panel(this);
@ -30,18 +32,20 @@ CaliPresetCaliStagePanel::CaliPresetCaliStagePanel(
void CaliPresetCaliStagePanel::create_panel(wxWindow* parent)
{
auto title = new wxStaticText(parent, wxID_ANY, _L("Calibration Type"));
auto title = new Label(parent, _L("Calibration Type"));
title->SetFont(Label::Head_14);
m_top_sizer->Add(title);
m_top_sizer->AddSpacer(FromDIP(15));
m_complete_radioBox = new wxRadioButton(parent, wxID_ANY, _L("Complete Calibration"));
m_complete_radioBox->SetForegroundColour(*wxBLACK);
m_complete_radioBox->SetValue(true);
m_stage = CALI_MANUAL_STAGE_1;
m_top_sizer->Add(m_complete_radioBox);
m_top_sizer->AddSpacer(FromDIP(10));
m_fine_radioBox = new wxRadioButton(parent, wxID_ANY, _L("Fine Calibration based on flow ratio"));
m_fine_radioBox->SetForegroundColour(*wxBLACK);
m_top_sizer->Add(m_fine_radioBox);
auto input_panel = new wxPanel(parent);
@ -135,6 +139,8 @@ CaliPresetWarningPanel::CaliPresetWarningPanel(
long style)
: wxPanel(parent, id, pos, size, style)
{
SetBackgroundColour(*wxWHITE);
m_top_sizer = new wxBoxSizer(wxHORIZONTAL);
create_panel(this);
@ -145,7 +151,7 @@ CaliPresetWarningPanel::CaliPresetWarningPanel(
void CaliPresetWarningPanel::create_panel(wxWindow* parent)
{
m_warning_text = new wxStaticText(parent, wxID_ANY, wxEmptyString);
m_warning_text = new Label(parent, wxEmptyString);
m_warning_text->SetFont(Label::Body_13);
m_warning_text->SetForegroundColour(wxColour(230, 92, 92));
m_warning_text->Wrap(CALIBRATION_TEXT_MAX_LENGTH);
@ -226,7 +232,7 @@ void CaliPresetCustomRangePanel::create_panel(wxWindow* parent)
wxBoxSizer *item_sizer;
item_sizer = new wxBoxSizer(wxVERTICAL);
m_title_texts[i] = new wxStaticText(parent, wxID_ANY, _L("Title"), wxDefaultPosition, wxDefaultSize, 0);
m_title_texts[i] = new Label(parent, _L("Title"));
m_title_texts[i]->Wrap(-1);
m_title_texts[i]->SetFont(::Label::Body_14);
item_sizer->Add(m_title_texts[i], 0, wxALL, 0);
@ -263,7 +269,7 @@ void CaliPresetTipsPanel::create_panel(wxWindow* parent)
{
m_top_sizer->AddSpacer(FromDIP(10));
auto preset_panel_tips = new wxStaticText(parent, wxID_ANY, _L("A test model will be printed. Please clear the build plate and place it back to the hot bed before calibration."));
auto preset_panel_tips = new Label(parent, _L("A test model will be printed. Please clear the build plate and place it back to the hot bed before calibration."));
preset_panel_tips->SetFont(Label::Body_14);
preset_panel_tips->Wrap(CALIBRATION_TEXT_MAX_LENGTH * 1.5f);
m_top_sizer->Add(preset_panel_tips, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(20));
@ -275,7 +281,7 @@ void CaliPresetTipsPanel::create_panel(wxWindow* parent)
info_sizer->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
auto nozzle_temp_sizer = new wxBoxSizer(wxVERTICAL);
auto nozzle_temp_text = new wxStaticText(parent, wxID_ANY, _L("Nozzle temperature"));
auto nozzle_temp_text = new Label(parent, _L("Nozzle temperature"));
nozzle_temp_text->SetFont(Label::Body_12);
m_nozzle_temp = new TextInput(parent, wxEmptyString, _L("\u2103"), "", wxDefaultPosition, CALIBRATION_FROM_TO_INPUT_SIZE, wxTE_READONLY);
m_nozzle_temp->SetBorderWidth(0);
@ -285,20 +291,20 @@ void CaliPresetTipsPanel::create_panel(wxWindow* parent)
m_nozzle_temp->Hide();
auto bed_temp_sizer = new wxBoxSizer(wxHORIZONTAL);
auto printing_param_text = new wxStaticText(parent, wxID_ANY, _L("Printing Parameters"));
auto printing_param_text = new Label(parent, _L("Printing Parameters"));
printing_param_text->SetFont(Label::Head_12);
printing_param_text->Wrap(CALIBRATION_TEXT_MAX_LENGTH);
bed_temp_sizer->Add(printing_param_text, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(20));
auto bed_temp_text = new wxStaticText(parent, wxID_ANY, _L("Bed temperature"));
auto bed_temp_text = new Label(parent, _L("Bed temperature"));
bed_temp_text->SetFont(Label::Body_12);
m_bed_temp = new wxStaticText(parent, wxID_ANY, _L("- \u2103"));
m_bed_temp = new Label(parent, _L("- \u2103"));
m_bed_temp->SetFont(Label::Body_12);
bed_temp_sizer->Add(bed_temp_text, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(10));
bed_temp_sizer->Add(m_bed_temp, 0, wxALIGN_CENTER);
auto max_flow_sizer = new wxBoxSizer(wxVERTICAL);
auto max_flow_text = new wxStaticText(parent, wxID_ANY, _L("Max volumetric speed"));
auto max_flow_text = new Label(parent, _L("Max volumetric speed"));
max_flow_text->SetFont(Label::Body_12);
m_max_volumetric_speed = new TextInput(parent, wxEmptyString, _L("mm\u00B3"), "", wxDefaultPosition, CALIBRATION_FROM_TO_INPUT_SIZE, wxTE_READONLY);
m_max_volumetric_speed->SetBorderWidth(0);
@ -382,7 +388,7 @@ void CalibrationPresetPage::create_selection_panel(wxWindow* parent)
{
auto panel_sizer = new wxBoxSizer(wxVERTICAL);
auto nozzle_combo_text = new wxStaticText(parent, wxID_ANY, _L("Nozzle Diameter"), wxDefaultPosition, wxDefaultSize, 0);
auto nozzle_combo_text = new Label(parent, _L("Nozzle Diameter"));
nozzle_combo_text->SetFont(Label::Head_14);
nozzle_combo_text->Wrap(-1);
panel_sizer->Add(nozzle_combo_text, 0, wxALL, 0);
@ -392,7 +398,7 @@ void CalibrationPresetPage::create_selection_panel(wxWindow* parent)
panel_sizer->AddSpacer(PRESET_GAP);
auto plate_type_combo_text = new wxStaticText(parent, wxID_ANY, _L("Plate Type"), wxDefaultPosition, wxDefaultSize, 0);
auto plate_type_combo_text = new Label(parent, _L("Plate Type"));
plate_type_combo_text->SetFont(Label::Head_14);
plate_type_combo_text->Wrap(-1);
panel_sizer->Add(plate_type_combo_text, 0, wxALL, 0);
@ -405,7 +411,7 @@ void CalibrationPresetPage::create_selection_panel(wxWindow* parent)
m_filament_from_panel = new wxPanel(parent);
m_filament_from_panel->Hide();
auto filament_from_sizer = new wxBoxSizer(wxVERTICAL);
auto filament_from_text = new wxStaticText(m_filament_from_panel, wxID_ANY, _L("filament position"));
auto filament_from_text = new Label(m_filament_from_panel, _L("filament position"));
filament_from_text->SetFont(Label::Head_14);
filament_from_sizer->Add(filament_from_text, 0);
auto raioBox_sizer = new wxFlexGridSizer(2, 1, 0, FromDIP(10));
@ -420,7 +426,7 @@ void CalibrationPresetPage::create_selection_panel(wxWindow* parent)
panel_sizer->Add(m_filament_from_panel, 0, wxBOTTOM, PRESET_GAP);
auto filament_for_title_sizer = new wxBoxSizer(wxHORIZONTAL);
auto filament_for_text = new wxStaticText(parent, wxID_ANY, _L("Filament For Calibration"), wxDefaultPosition, wxDefaultSize, 0);
auto filament_for_text = new Label(parent, _L("Filament For Calibration"));
filament_for_text->SetFont(Label::Head_14);
filament_for_title_sizer->Add(filament_for_text, 0, wxALIGN_CENTER);
filament_for_title_sizer->AddSpacer(FromDIP(25));
@ -472,7 +478,7 @@ void CalibrationPresetPage::create_filament_list_panel(wxWindow* parent)
{
auto panel_sizer = new wxBoxSizer(wxVERTICAL);
m_filament_list_tips = new wxStaticText(parent, wxID_ANY, _L("Tips for calibration material: \n- Materials that can share same hot bed temperature\n- Different filament brand and family(Brand = Bambu, Family = Basic, Matte)"), wxDefaultPosition, wxDefaultSize, 0);
m_filament_list_tips = new Label(parent, _L("Tips for calibration material: \n- Materials that can share same hot bed temperature\n- Different filament brand and family(Brand = Bambu, Family = Basic, Matte)"));
m_filament_list_tips->Hide();
m_filament_list_tips->SetFont(Label::Body_13);
m_filament_list_tips->SetForegroundColour(wxColour(145, 145, 145));
@ -606,8 +612,8 @@ void CalibrationPresetPage::create_sending_panel(wxWindow* parent)
wxBoxSizer* sizer_error_desc = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* sizer_extra_info = new wxBoxSizer(wxHORIZONTAL);
auto st_title_error_code = new wxStaticText(m_sw_print_failed_info, wxID_ANY, _L("Error code"));
auto st_title_error_code_doc = new wxStaticText(m_sw_print_failed_info, wxID_ANY, ": ");
auto st_title_error_code = new Label(m_sw_print_failed_info, _L("Error code"));
auto st_title_error_code_doc = new Label(m_sw_print_failed_info, ": ");
m_st_txt_error_code = new Label(m_sw_print_failed_info, wxEmptyString);
st_title_error_code->SetForegroundColour(0x909090);
st_title_error_code_doc->SetForegroundColour(0x909090);
@ -623,8 +629,8 @@ void CalibrationPresetPage::create_sending_panel(wxWindow* parent)
sizer_error_code->Add(st_title_error_code_doc, 0, wxALL, 0);
sizer_error_code->Add(m_st_txt_error_code, 0, wxALL, 0);
auto st_title_error_desc = new wxStaticText(m_sw_print_failed_info, wxID_ANY, _L("Error desc"));
auto st_title_error_desc_doc = new wxStaticText(m_sw_print_failed_info, wxID_ANY, ": ");
auto st_title_error_desc = new Label(m_sw_print_failed_info, _L("Error desc"));
auto st_title_error_desc_doc = new Label(m_sw_print_failed_info, ": ");
m_st_txt_error_desc = new Label(m_sw_print_failed_info, wxEmptyString);
st_title_error_desc->SetForegroundColour(0x909090);
st_title_error_desc_doc->SetForegroundColour(0x909090);
@ -640,8 +646,8 @@ void CalibrationPresetPage::create_sending_panel(wxWindow* parent)
sizer_error_desc->Add(st_title_error_desc_doc, 0, wxALL, 0);
sizer_error_desc->Add(m_st_txt_error_desc, 0, wxALL, 0);
auto st_title_extra_info = new wxStaticText(m_sw_print_failed_info, wxID_ANY, _L("Extra info"));
auto st_title_extra_info_doc = new wxStaticText(m_sw_print_failed_info, wxID_ANY, ": ");
auto st_title_extra_info = new Label(m_sw_print_failed_info, _L("Extra info"));
auto st_title_extra_info_doc = new Label(m_sw_print_failed_info, ": ");
m_st_txt_extra_info = new Label(m_sw_print_failed_info, wxEmptyString);
st_title_extra_info->SetForegroundColour(0x909090);
st_title_extra_info_doc->SetForegroundColour(0x909090);
@ -698,10 +704,12 @@ void CalibrationPresetPage::create_page(wxWindow* parent)
m_top_sizer->Add(m_cali_stage_panel, 0);
m_selection_panel = new wxPanel(parent);
m_selection_panel->SetBackgroundColour(*wxWHITE);
create_selection_panel(m_selection_panel);
init_selection_values();
m_filament_list_panel = new wxPanel(parent);
m_filament_list_panel->SetBackgroundColour(*wxWHITE);
create_filament_list_panel(m_filament_list_panel);
m_ext_spool_panel = new wxPanel(parent);
@ -713,6 +721,7 @@ void CalibrationPresetPage::create_page(wxWindow* parent)
m_tips_panel = new CaliPresetTipsPanel(parent);
m_sending_panel = new wxPanel(parent);
m_sending_panel->SetBackgroundColour(*wxWHITE);
create_sending_panel(m_sending_panel);
m_sending_panel->Hide();
@ -723,7 +732,7 @@ void CalibrationPresetPage::create_page(wxWindow* parent)
m_action_panel = new CaliPageActionPanel(parent, m_cali_mode, CaliPageType::CALI_PAGE_PRESET);
m_statictext_printer_msg = new wxStaticText(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL);
m_statictext_printer_msg = new Label(this, wxEmptyString, wxALIGN_CENTER_HORIZONTAL);
m_statictext_printer_msg->SetFont(::Label::Body_13);
m_statictext_printer_msg->Hide();

View file

@ -54,7 +54,7 @@ public:
void set_warning(wxString text);
protected:
wxBoxSizer* m_top_sizer;
wxStaticText* m_warning_text;
Label* m_warning_text;
};
class CaliPresetTipsPanel : public wxPanel
@ -73,7 +73,7 @@ public:
protected:
wxBoxSizer* m_top_sizer;
TextInput* m_nozzle_temp;
wxStaticText* m_bed_temp;
Label* m_bed_temp;
TextInput* m_max_volumetric_speed;
};
@ -97,7 +97,7 @@ public:
protected:
wxBoxSizer* m_top_sizer;
int m_input_value_nums;
std::vector<wxStaticText*> m_title_texts;
std::vector<Label*> m_title_texts;
std::vector<TextInput*> m_value_inputs;
};
@ -230,7 +230,7 @@ protected:
CaliPresetCaliStagePanel* m_cali_stage_panel { nullptr };
wxPanel* m_selection_panel { nullptr };
wxPanel* m_filament_from_panel { nullptr };
wxStaticText* m_filament_list_tips{ nullptr };
Label* m_filament_list_tips{ nullptr };
wxPanel* m_multi_ams_panel { nullptr };
wxPanel* m_filament_list_panel { nullptr };
wxPanel* m_ext_spool_panel { nullptr };

View file

@ -105,6 +105,8 @@ CaliPASaveAutoPanel::CaliPASaveAutoPanel(
long style)
: wxPanel(parent, id, pos, size, style)
{
SetBackgroundColour(*wxWHITE);
m_top_sizer = new wxBoxSizer(wxVERTICAL);
create_panel(this);
@ -117,9 +119,10 @@ CaliPASaveAutoPanel::CaliPASaveAutoPanel(
void CaliPASaveAutoPanel::create_panel(wxWindow* parent)
{
m_complete_text_panel = new wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_complete_text_panel->SetBackgroundColour(*wxWHITE);
m_complete_text_panel->Hide();
wxBoxSizer* complete_text_sizer = new wxBoxSizer(wxVERTICAL);
auto complete_text = new wxStaticText(m_complete_text_panel, wxID_ANY, _L("We found the best Flow Dynamics Calibration Factor"));
auto complete_text = new Label(m_complete_text_panel, _L("We found the best Flow Dynamics Calibration Factor"));
complete_text->SetFont(Label::Head_14);
complete_text_sizer->Add(complete_text, 0, wxEXPAND);
m_complete_text_panel->SetSizer(complete_text_sizer);
@ -129,7 +132,7 @@ void CaliPASaveAutoPanel::create_panel(wxWindow* parent)
wxBoxSizer* part_failed_sizer = new wxBoxSizer(wxVERTICAL);
m_part_failed_panel->SetSizer(part_failed_sizer);
part_failed_sizer->AddSpacer(FromDIP(10));
auto part_failed_text = new wxStaticText(m_part_failed_panel, wxID_ANY, _L("Part of the calibration failed! You may clean the plate and retry. The failed test result would be droped."));
auto part_failed_text = new Label(m_part_failed_panel, _L("Part of the calibration failed! You may clean the plate and retry. The failed test result would be droped."));
part_failed_text->SetFont(Label::Body_14);
part_failed_sizer->Add(part_failed_text, 0, wxLEFT | wxRIGHT, FromDIP(20));
part_failed_sizer->AddSpacer(FromDIP(10));
@ -143,11 +146,12 @@ void CaliPASaveAutoPanel::create_panel(wxWindow* parent)
m_top_sizer->AddSpacer(FromDIP(20));
m_grid_panel = new wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_grid_panel->SetBackgroundColour(*wxWHITE);
m_top_sizer->Add(m_grid_panel, 0, wxALIGN_CENTER);
m_top_sizer->AddSpacer(FromDIP(10));
wxStaticText* naming_hints = new wxStaticText(parent, wxID_ANY, _L("*We recommend you to add brand, materia, type, and even humidity level in the Name"));
auto naming_hints = new Label(parent, _L("*We recommend you to add brand, materia, type, and even humidity level in the Name"));
naming_hints->SetFont(Label::Body_14);
naming_hints->SetForegroundColour(wxColour(157, 157, 157));
m_top_sizer->Add(naming_hints, 0, wxEXPAND, 0);
@ -169,15 +173,15 @@ void CaliPASaveAutoPanel::sync_cali_result(const std::vector<PACalibResult>& cal
const int ROW_GAP = FromDIP(30);
wxBoxSizer* left_title_sizer = new wxBoxSizer(wxVERTICAL);
left_title_sizer->AddSpacer(FromDIP(52));
auto k_title = new wxStaticText(m_grid_panel, wxID_ANY, _L("Factor K"), wxDefaultPosition, wxDefaultSize, 0);
auto k_title = new Label(m_grid_panel, _L("Factor K"));
k_title->SetFont(Label::Head_14);
left_title_sizer->Add(k_title, 0, wxALIGN_CENTER | wxBOTTOM, ROW_GAP);
auto n_title = new wxStaticText(m_grid_panel, wxID_ANY, _L("Factor N"), wxDefaultPosition, wxDefaultSize, 0);
auto n_title = new Label(m_grid_panel, _L("Factor N"));
n_title->SetFont(Label::Head_14);
// hide n value
n_title->Hide();
left_title_sizer->Add(n_title, 0, wxALIGN_CENTER | wxBOTTOM, ROW_GAP);
auto brand_title = new wxStaticText(m_grid_panel, wxID_ANY, _L("Name"), wxDefaultPosition, wxDefaultSize, 0);
auto brand_title = new Label(m_grid_panel, _L("Name"));
brand_title->SetFont(Label::Head_14);
left_title_sizer->Add(brand_title, 0, wxALIGN_CENTER);
grid_sizer->Add(left_title_sizer);
@ -198,7 +202,7 @@ void CaliPASaveAutoPanel::sync_cali_result(const std::vector<PACalibResult>& cal
}
wxBoxSizer* column_data_sizer = new wxBoxSizer(wxVERTICAL);
auto tray_title = new wxStaticText(m_grid_panel, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, 0);
auto tray_title = new Label(m_grid_panel, "");
tray_title->SetFont(Label::Head_14);
wxString tray_name;
if (item.tray_id == VIRTUAL_TRAY_ID) {
@ -215,11 +219,11 @@ void CaliPASaveAutoPanel::sync_cali_result(const std::vector<PACalibResult>& cal
auto n_value = new GridTextInput(m_grid_panel, "", "", CALIBRATION_SAVE_INPUT_SIZE, item.tray_id, GridTextInputType::N);
k_value->GetTextCtrl()->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
n_value->GetTextCtrl()->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
auto k_value_failed = new wxStaticText(m_grid_panel, wxID_ANY, _L("Failed"), wxDefaultPosition);
auto n_value_failed = new wxStaticText(m_grid_panel, wxID_ANY, _L("Failed"), wxDefaultPosition);
auto k_value_failed = new Label(m_grid_panel, _L("Failed"));
auto n_value_failed = new Label(m_grid_panel, _L("Failed"));
auto comboBox_tray_name = new GridComboBox(m_grid_panel, CALIBRATION_SAVE_INPUT_SIZE, item.tray_id);
auto tray_name_failed = new wxStaticText(m_grid_panel, wxID_ANY, " - ", wxDefaultPosition);
auto tray_name_failed = new Label(m_grid_panel, " - ");
wxArrayString selections;
static std::vector<PACalibResult> filtered_results;
filtered_results.clear();
@ -314,6 +318,8 @@ void CaliPASaveAutoPanel::sync_cali_result(const std::vector<PACalibResult>& cal
m_part_failed_panel->Hide();
}
wxGetApp().UpdateDarkUIWin(this);
Layout();
}
@ -412,6 +418,8 @@ CaliPASaveManualPanel::CaliPASaveManualPanel(
long style)
: wxPanel(parent, id, pos, size, style)
{
SetBackgroundColour(*wxWHITE);
m_top_sizer = new wxBoxSizer(wxVERTICAL);
create_panel(this);
@ -423,8 +431,9 @@ CaliPASaveManualPanel::CaliPASaveManualPanel(
void CaliPASaveManualPanel::create_panel(wxWindow* parent)
{
auto complete_text_panel = new wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
complete_text_panel->SetBackgroundColour(*wxWHITE);
wxBoxSizer* complete_text_sizer = new wxBoxSizer(wxVERTICAL);
auto complete_text = new wxStaticText(complete_text_panel, wxID_ANY, _L("Please find the best line on your plate"));
auto complete_text = new Label(complete_text_panel, _L("Please find the best line on your plate"));
complete_text->SetFont(Label::Head_14);
complete_text->Wrap(CALIBRATION_TEXT_MAX_LENGTH);
complete_text_sizer->Add(complete_text, 0);
@ -439,10 +448,10 @@ void CaliPASaveManualPanel::create_panel(wxWindow* parent)
m_top_sizer->AddSpacer(FromDIP(20));
auto k_value_text = new wxStaticText(parent, wxID_ANY, _L("Factor K"), wxDefaultPosition, wxDefaultSize, 0);
auto k_value_text = new Label(parent, _L("Factor K"));
k_value_text->SetFont(::Label::Head_14);
k_value_text->Wrap(-1);
auto n_value_text = new wxStaticText(parent, wxID_ANY, _L("Factor N"), wxDefaultPosition, wxDefaultSize, 0);
auto n_value_text = new Label(parent, _L("Factor N"));
n_value_text->SetFont(::Label::Head_14);
n_value_text->Wrap(-1);
n_value_text->Hide();
@ -456,7 +465,7 @@ void CaliPASaveManualPanel::create_panel(wxWindow* parent)
m_top_sizer->AddSpacer(FromDIP(20));
auto save_text = new wxStaticText(parent, wxID_ANY, _L("Name"), wxDefaultPosition, wxDefaultSize, 0);
auto save_text = new Label(parent, _L("Name"));
save_text->SetFont(Label::Head_14);
m_top_sizer->Add(save_text, 0, 0, 0);
@ -465,7 +474,7 @@ void CaliPASaveManualPanel::create_panel(wxWindow* parent)
m_top_sizer->AddSpacer(FromDIP(10));
wxStaticText* naming_hints = new wxStaticText(parent, wxID_ANY, _L("*We recommend you to add brand, materia, type, and even humidity level in the Name"));
auto naming_hints = new Label(parent, _L("*We recommend you to add brand, materia, type, and even humidity level in the Name"));
naming_hints->SetFont(Label::Body_14);
naming_hints->SetForegroundColour(wxColour(157, 157, 157));
m_top_sizer->Add(naming_hints, 0, wxEXPAND, 0);
@ -553,6 +562,8 @@ CaliPASaveP1PPanel::CaliPASaveP1PPanel(
long style)
: wxPanel(parent, id, pos, size, style)
{
SetBackgroundColour(*wxWHITE);
m_top_sizer = new wxBoxSizer(wxVERTICAL);
create_panel(this);
@ -564,8 +575,9 @@ CaliPASaveP1PPanel::CaliPASaveP1PPanel(
void CaliPASaveP1PPanel::create_panel(wxWindow* parent)
{
auto complete_text_panel = new wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
complete_text_panel->SetBackgroundColour(*wxWHITE);
wxBoxSizer* complete_text_sizer = new wxBoxSizer(wxVERTICAL);
auto complete_text = new wxStaticText(complete_text_panel, wxID_ANY, _L("Please find the best line on your plate"));
auto complete_text = new Label(complete_text_panel, _L("Please find the best line on your plate"));
complete_text->SetFont(Label::Head_14);
complete_text->Wrap(CALIBRATION_TEXT_MAX_LENGTH);
complete_text_sizer->Add(complete_text, 0, wxEXPAND);
@ -581,10 +593,10 @@ void CaliPASaveP1PPanel::create_panel(wxWindow* parent)
m_top_sizer->AddSpacer(FromDIP(20));
auto value_sizer = new wxBoxSizer(wxHORIZONTAL);
auto k_value_text = new wxStaticText(parent, wxID_ANY, _L("Factor K"), wxDefaultPosition, wxDefaultSize, 0);
auto k_value_text = new Label(parent, _L("Factor K"));
k_value_text->Wrap(-1);
k_value_text->SetFont(::Label::Head_14);
auto n_value_text = new wxStaticText(parent, wxID_ANY, _L("Factor N"), wxDefaultPosition, wxDefaultSize, 0);
auto n_value_text = new Label(parent, _L("Factor N"));
n_value_text->Wrap(-1);
n_value_text->SetFont(::Label::Head_14);
m_k_val = new TextInput(parent, wxEmptyString, "", "", wxDefaultPosition, CALIBRATION_OPTIMAL_INPUT_SIZE, 0);
@ -631,6 +643,8 @@ CaliSavePresetValuePanel::CaliSavePresetValuePanel(
long style)
: wxPanel(parent, id, pos, size, style)
{
SetBackgroundColour(*wxWHITE);
m_top_sizer = new wxBoxSizer(wxVERTICAL);
create_panel(this);
@ -643,13 +657,13 @@ void CaliSavePresetValuePanel::create_panel(wxWindow *parent)
{
m_picture_panel = new CaliPagePicture(parent);
m_value_title = new wxStaticText(parent, wxID_ANY, _L("Input Value"), wxDefaultPosition, wxDefaultSize, 0);
m_value_title = new Label(parent, _L("Input Value"));
m_value_title->SetFont(Label::Head_14);
m_value_title->Wrap(-1);
m_input_value = new TextInput(parent, wxEmptyString, "", "", wxDefaultPosition, CALIBRATION_OPTIMAL_INPUT_SIZE, wxTE_PROCESS_ENTER);
m_input_value->GetTextCtrl()->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
m_save_name_title = new wxStaticText(parent, wxID_ANY, _L("Save to Filament Preset"), wxDefaultPosition, wxDefaultSize, 0);
m_save_name_title = new Label(parent, _L("Save to Filament Preset"));
m_save_name_title->Wrap(-1);
m_save_name_title->SetFont(Label::Head_14);
@ -698,6 +712,8 @@ void CaliSavePresetValuePanel::set_save_name(const std::string& name)
CalibrationPASavePage::CalibrationPASavePage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
: CalibrationCommonSavePage(parent, id, pos, size, style)
{
SetBackgroundColour(*wxWHITE);
m_cali_mode = CalibMode::Calib_PA_Line;
m_page_type = CaliPageType::CALI_PAGE_PA_SAVE;
@ -815,6 +831,8 @@ bool CalibrationPASavePage::Show(bool show) {
CalibrationFlowX1SavePage::CalibrationFlowX1SavePage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
: CalibrationCommonSavePage(parent, id, pos, size, style)
{
SetBackgroundColour(*wxWHITE);
m_cali_mode = CalibMode::Calib_Flow_Rate;
m_page_type = CaliPageType::CALI_PAGE_FLOW_SAVE;
@ -844,7 +862,7 @@ void CalibrationFlowX1SavePage::create_page(wxWindow* parent)
m_complete_text_panel = new wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_complete_text_panel->Hide();
wxBoxSizer* complete_text_sizer = new wxBoxSizer(wxVERTICAL);
auto complete_text = new wxStaticText(m_complete_text_panel, wxID_ANY, _L("We found the best flow ratio for you"));
auto complete_text = new Label(m_complete_text_panel, _L("We found the best flow ratio for you"));
complete_text->SetFont(Label::Head_14);
complete_text_sizer->Add(complete_text, 0, wxEXPAND);
m_complete_text_panel->SetSizer(complete_text_sizer);
@ -854,7 +872,7 @@ void CalibrationFlowX1SavePage::create_page(wxWindow* parent)
wxBoxSizer* part_failed_sizer = new wxBoxSizer(wxVERTICAL);
m_part_failed_panel->SetSizer(part_failed_sizer);
part_failed_sizer->AddSpacer(FromDIP(10));
auto part_failed_text = new wxStaticText(m_part_failed_panel, wxID_ANY, _L("Part of the calibration failed! You may clean the plate and retry. The failed test result would be droped."));
auto part_failed_text = new Label(m_part_failed_panel, _L("Part of the calibration failed! You may clean the plate and retry. The failed test result would be droped."));
part_failed_text->SetFont(Label::Body_14);
part_failed_sizer->Add(part_failed_text, 0, wxLEFT | wxRIGHT, FromDIP(20));
part_failed_sizer->AddSpacer(FromDIP(10));
@ -868,6 +886,7 @@ void CalibrationFlowX1SavePage::create_page(wxWindow* parent)
m_top_sizer->AddSpacer(FromDIP(20));
m_grid_panel = new wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_grid_panel->SetBackgroundColour(*wxWHITE);
m_top_sizer->Add(m_grid_panel, 0, wxALIGN_CENTER);
m_action_panel = new CaliPageActionPanel(parent, m_cali_mode, CaliPageType::CALI_PAGE_FLOW_SAVE);
@ -883,10 +902,10 @@ void CalibrationFlowX1SavePage::sync_cali_result(const std::vector<FlowRatioCali
const int ROW_GAP = FromDIP(30);
wxBoxSizer* left_title_sizer = new wxBoxSizer(wxVERTICAL);
left_title_sizer->AddSpacer(FromDIP(49));
auto flow_ratio_title = new wxStaticText(m_grid_panel, wxID_ANY, _L("Flow Ratio"), wxDefaultPosition, wxDefaultSize, 0);
auto flow_ratio_title = new Label(m_grid_panel, _L("Flow Ratio"));
flow_ratio_title->SetFont(Label::Head_14);
left_title_sizer->Add(flow_ratio_title, 0, wxALIGN_CENTER | wxBOTTOM, ROW_GAP + FromDIP(10));
auto brand_title = new wxStaticText(m_grid_panel, wxID_ANY, _L("Save to Filament Preset"), wxDefaultPosition, wxDefaultSize, 0);
auto brand_title = new Label(m_grid_panel, _L("Save to Filament Preset"));
brand_title->SetFont(Label::Head_14);
left_title_sizer->Add(brand_title, 0, wxALIGN_CENTER);
grid_sizer->Add(left_title_sizer);
@ -907,7 +926,7 @@ void CalibrationFlowX1SavePage::sync_cali_result(const std::vector<FlowRatioCali
}
wxBoxSizer* column_data_sizer = new wxBoxSizer(wxVERTICAL);
auto tray_title = new wxStaticText(m_grid_panel, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, 0);
auto tray_title = new Label(m_grid_panel, "");
tray_title->SetFont(Label::Head_14);
wxString tray_name;
if (item.tray_id == VIRTUAL_TRAY_ID) {
@ -922,10 +941,10 @@ void CalibrationFlowX1SavePage::sync_cali_result(const std::vector<FlowRatioCali
auto flow_ratio_value = new GridTextInput(m_grid_panel, "", "", CALIBRATION_SAVE_INPUT_SIZE, item.tray_id, GridTextInputType::FlowRatio);
flow_ratio_value->GetTextCtrl()->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
auto flow_ratio_value_failed = new wxStaticText(m_grid_panel, wxID_ANY, _L("Failed"), wxDefaultPosition);
auto flow_ratio_value_failed = new Label(m_grid_panel, _L("Failed"));
auto save_name_input = new GridTextInput(m_grid_panel, "", "", { CALIBRATION_TEXT_MAX_LENGTH, FromDIP(24) }, item.tray_id, GridTextInputType::Name);
auto save_name_input_failed = new wxStaticText(m_grid_panel, wxID_ANY, " - ", wxDefaultPosition);
auto save_name_input_failed = new Label(m_grid_panel, " - ");
column_data_sizer->Add(tray_title, 0, wxALIGN_CENTER | wxBOTTOM, ROW_GAP);
column_data_sizer->Add(flow_ratio_value, 0, wxALIGN_LEFT | wxBOTTOM, ROW_GAP);
@ -989,6 +1008,8 @@ void CalibrationFlowX1SavePage::sync_cali_result(const std::vector<FlowRatioCali
m_part_failed_panel->Hide();
}
wxGetApp().UpdateDarkUIWin(this);
Layout();
}
@ -1056,6 +1077,8 @@ bool CalibrationFlowX1SavePage::Show(bool show) {
CalibrationFlowCoarseSavePage::CalibrationFlowCoarseSavePage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
: CalibrationCommonSavePage(parent, id, pos, size, style)
{
SetBackgroundColour(*wxWHITE);
m_cali_mode = CalibMode::Calib_Flow_Rate;
m_page_type = CaliPageType::CALI_PAGE_COARSE_SAVE;
@ -1083,7 +1106,7 @@ void CalibrationFlowCoarseSavePage::create_page(wxWindow* parent)
m_step_panel->set_steps(1);
m_top_sizer->Add(m_step_panel, 0, wxEXPAND, 0);
auto complete_text = new wxStaticText(parent, wxID_ANY, _L("Please find the best object on your plate"), wxDefaultPosition, wxDefaultSize, 0);
auto complete_text = new Label(parent, _L("Please find the best object on your plate"));
complete_text->SetFont(Label::Head_14);
complete_text->Wrap(-1);
m_top_sizer->Add(complete_text, 0, wxEXPAND, 0);
@ -1096,7 +1119,7 @@ void CalibrationFlowCoarseSavePage::create_page(wxWindow* parent)
m_top_sizer->AddSpacer(FromDIP(20));
auto coarse_value_sizer = new wxBoxSizer(wxVERTICAL);
auto coarse_value_text = new wxStaticText(parent, wxID_ANY, _L("Fill in the value above the block with smoothest top surface"), wxDefaultPosition, wxDefaultSize, 0);
auto coarse_value_text = new Label(parent, _L("Fill in the value above the block with smoothest top surface"));
coarse_value_text->SetFont(Label::Head_14);
coarse_value_text->Wrap(-1);
m_optimal_block_coarse = new ComboBox(parent, wxID_ANY, "", wxDefaultPosition, CALIBRATION_OPTIMAL_INPUT_SIZE, 0, nullptr, wxCB_READONLY);
@ -1105,7 +1128,7 @@ void CalibrationFlowCoarseSavePage::create_page(wxWindow* parent)
coarse_block_items.Add(std::to_string(-20 + (i * 5)));
}
m_optimal_block_coarse->Set(coarse_block_items);
auto coarse_calc_result_text = new wxStaticText(parent, wxID_ANY, "");
auto coarse_calc_result_text = new Label(parent, "");
coarse_value_sizer->Add(coarse_value_text, 0, 0);
coarse_value_sizer->Add(m_optimal_block_coarse, 0, 0);
coarse_value_sizer->Add(coarse_calc_result_text, 0);
@ -1113,12 +1136,13 @@ void CalibrationFlowCoarseSavePage::create_page(wxWindow* parent)
m_top_sizer->AddSpacer(FromDIP(20));
auto checkBox_panel = new wxPanel(parent);
checkBox_panel->SetBackgroundColour(*wxWHITE);
auto cb_sizer = new wxBoxSizer(wxHORIZONTAL);
checkBox_panel->SetSizer(cb_sizer);
auto checkBox_skip_calibration = new CheckBox(checkBox_panel);
cb_sizer->Add(checkBox_skip_calibration);
auto cb_text = new wxStaticText(checkBox_panel, wxID_ANY, _L("Skip Calibration2"));
auto cb_text = new Label(checkBox_panel, _L("Skip Calibration2"));
cb_sizer->Add(cb_text);
cb_text->Bind(wxEVT_LEFT_DOWN, [this, checkBox_skip_calibration](auto&) {
checkBox_skip_calibration->SetValue(!checkBox_skip_calibration->GetValue());
@ -1130,10 +1154,11 @@ void CalibrationFlowCoarseSavePage::create_page(wxWindow* parent)
m_top_sizer->Add(checkBox_panel, 0, 0, 0);
auto save_panel = new wxPanel(parent);
save_panel->SetBackgroundColour(*wxWHITE);
auto save_sizer = new wxBoxSizer(wxVERTICAL);
save_panel->SetSizer(save_sizer);
auto save_text = new wxStaticText(save_panel, wxID_ANY, _L("Save to Filament Preset"), wxDefaultPosition, wxDefaultSize, 0);
auto save_text = new Label(save_panel, _L("Save to Filament Preset"));
save_text->Wrap(-1);
save_text->SetFont(Label::Head_14);
save_sizer->Add(save_text, 0, 0, 0);
@ -1227,6 +1252,8 @@ bool CalibrationFlowCoarseSavePage::Show(bool show) {
CalibrationFlowFineSavePage::CalibrationFlowFineSavePage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
: CalibrationCommonSavePage(parent, id, pos, size, style)
{
SetBackgroundColour(*wxWHITE);
m_cali_mode = CalibMode::Calib_Flow_Rate;
m_page_type = CaliPageType::CALI_PAGE_FINE_SAVE;
@ -1254,7 +1281,7 @@ void CalibrationFlowFineSavePage::create_page(wxWindow* parent)
m_step_panel->set_steps(3);
m_top_sizer->Add(m_step_panel, 0, wxEXPAND, 0);
auto complete_text = new wxStaticText(parent, wxID_ANY, _L("Please find the best object on your plate"), wxDefaultPosition, wxDefaultSize, 0);
auto complete_text = new Label(parent, _L("Please find the best object on your plate"));
complete_text->SetFont(Label::Head_14);
complete_text->Wrap(-1);
m_top_sizer->Add(complete_text, 0, wxEXPAND, 0);
@ -1267,7 +1294,7 @@ void CalibrationFlowFineSavePage::create_page(wxWindow* parent)
m_top_sizer->AddSpacer(FromDIP(20));
auto fine_value_sizer = new wxBoxSizer(wxVERTICAL);
auto fine_value_text = new wxStaticText(parent, wxID_ANY, _L("Fill in the value above the block with smoothest top surface"), wxDefaultPosition, wxDefaultSize, 0);
auto fine_value_text = new Label(parent, _L("Fill in the value above the block with smoothest top surface"));
fine_value_text->Wrap(-1);
fine_value_text->SetFont(::Label::Head_14);
m_optimal_block_fine = new ComboBox(parent, wxID_ANY, "", wxDefaultPosition, CALIBRATION_OPTIMAL_INPUT_SIZE, 0, nullptr, wxCB_READONLY);
@ -1276,14 +1303,14 @@ void CalibrationFlowFineSavePage::create_page(wxWindow* parent)
fine_block_items.Add(std::to_string(-9 + (i)));
}
m_optimal_block_fine->Set(fine_block_items);
auto fine_calc_result_text = new wxStaticText(parent, wxID_ANY, "");
auto fine_calc_result_text = new Label(parent, "");
fine_value_sizer->Add(fine_value_text, 0, 0);
fine_value_sizer->Add(m_optimal_block_fine, 0, 0);
fine_value_sizer->Add(fine_calc_result_text, 0);
m_top_sizer->Add(fine_value_sizer, 0, 0, 0);
m_top_sizer->AddSpacer(FromDIP(20));
auto save_text = new wxStaticText(parent, wxID_ANY, _L("Save to Filament Preset"), wxDefaultPosition, wxDefaultSize, 0);
auto save_text = new Label(parent, _L("Save to Filament Preset"));
save_text->Wrap(-1);
save_text->SetFont(Label::Head_14);
m_top_sizer->Add(save_text, 0, 0, 0);
@ -1356,6 +1383,8 @@ CalibrationMaxVolumetricSpeedSavePage::CalibrationMaxVolumetricSpeedSavePage(
long style)
: CalibrationCommonSavePage(parent, id, pos, size, style)
{
SetBackgroundColour(*wxWHITE);
m_cali_mode = CalibMode::Calib_Vol_speed_Tower;
m_page_type = CaliPageType::CALI_PAGE_COMMON_SAVE;

View file

@ -52,8 +52,8 @@ class CaliSavePresetValuePanel : public wxPanel
protected:
wxBoxSizer* m_top_sizer;
CaliPagePicture* m_picture_panel;
wxStaticText* m_value_title;
wxStaticText* m_save_name_title;
Label* m_value_title;
Label* m_save_name_title;
::TextInput* m_input_value;
::TextInput* m_input_name;

View file

@ -13,22 +13,22 @@ CalibrationStartPage::CalibrationStartPage(wxWindow* parent, wxWindowID id, cons
void CalibrationStartPage::create_when(wxWindow* parent, wxString title, wxString content)
{
m_when_title = new wxStaticText(this, wxID_ANY, title);
m_when_title = new Label(this, title);
m_when_title->SetFont(Label::Head_14);
m_when_title->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
m_when_content = new wxStaticText(this, wxID_ANY, content);
m_when_content = new Label(this, content);;
m_when_content->SetFont(Label::Body_14);
m_when_content->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
}
void CalibrationStartPage::create_about(wxWindow* parent, wxString title, wxString content)
{
m_about_title = new wxStaticText(this, wxID_ANY, title);
m_about_title = new Label(this, title);
m_about_title->SetFont(Label::Head_14);
m_about_title->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
m_about_content = new wxStaticText(this, wxID_ANY, content);
m_about_content = new Label(this, content);
m_about_content->SetFont(Label::Body_14);
m_about_content->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
}
@ -110,6 +110,15 @@ void CalibrationPAStartPage::create_page(wxWindow* parent)
m_action_panel = new CaliPageActionPanel(parent, CalibMode::Calib_PA_Line, CaliPageType::CALI_PAGE_START);
m_top_sizer->Add(m_action_panel, 0, wxEXPAND, 0);
#ifdef __linux__
wxGetApp().CallAfter([this]() {
m_when_content->SetMinSize(m_when_content->GetSize() + wxSize{ 0, wxWindow::GetCharHeight() / 2 });
m_about_content->SetMinSize(m_about_content->GetSize() + wxSize{ 0, wxWindow::GetCharHeight() / 2 });
Layout();
Fit();
});
#endif
}
void CalibrationPAStartPage::on_reset_page()
@ -194,7 +203,7 @@ void CalibrationFlowRateStartPage::create_page(wxWindow* parent)
m_top_sizer->Add(m_images_sizer, 0, wxALL, 0);
m_top_sizer->AddSpacer(PRESET_GAP);
auto extra_text = new wxStaticText(parent, wxID_ANY, _L("In addition, Flow Rate Calibration is crucial for foaming materials like LW-PLA used in RC planes. These materials expand greatly when heated, and calibration provides a useful reference flow rate."));
auto extra_text = new Label(parent, _L("In addition, Flow Rate Calibration is crucial for foaming materials like LW-PLA used in RC planes. These materials expand greatly when heated, and calibration provides a useful reference flow rate."));
extra_text->SetFont(Label::Body_14);
extra_text->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
m_top_sizer->Add(extra_text);
@ -208,11 +217,11 @@ void CalibrationFlowRateStartPage::create_page(wxWindow* parent)
m_top_sizer->Add(m_about_content);
m_top_sizer->AddSpacer(PRESET_GAP);
auto auto_cali_title = new wxStaticText(parent, wxID_ANY, _L("Auto-Calibration"));
auto auto_cali_title = new Label(parent, _L("Auto-Calibration"));
auto_cali_title->SetFont(Label::Head_14);
auto_cali_title->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
auto auto_cali_content = new wxStaticText(this, wxID_ANY,
auto auto_cali_content = new Label(this,
_L("Auto Flow Rate Calibration utilizes Bambu Lab's Micro-Lidar technology, directly measuring the calibration patterns. However, please be advised that the efficacy and accuracy of this method may be compromised with specific types of materials. Particularly, filaments that are transparent or semi-transparent, sparkling-particled, or have a high-reflective finish may not be suitable for this calibration and can produce less-than-desirable results.\
\n\nThe calibration results may vary between each calibration or filament. We are still improving the accuracy and compatibility of this calibration through firmware updates over time.\
\n\nCaution: Flow Rate Calibration is an advanced process, to be attempted only by those who fully understand its purpose and implications. Incorrect usage can lead to sub-par prints or printer damage. Please make sure to carefully read and understand the process before doing it."));
@ -226,6 +235,15 @@ void CalibrationFlowRateStartPage::create_page(wxWindow* parent)
m_action_panel = new CaliPageActionPanel(parent, CalibMode::Calib_Flow_Rate, CaliPageType::CALI_PAGE_START);
m_top_sizer->Add(m_action_panel, 0, wxEXPAND, 0);
#ifdef __linux__
wxGetApp().CallAfter([this, auto_cali_content]() {
m_when_content->SetMinSize(m_when_content->GetSize() + wxSize{ 0, wxWindow::GetCharHeight() / 2 });
auto_cali_content->SetMinSize(auto_cali_content->GetSize() + wxSize{ 0, wxWindow::GetCharHeight() / 2 });
Layout();
Fit();
});
#endif
}
void CalibrationFlowRateStartPage::on_reset_page()
@ -293,15 +311,15 @@ void CalibrationMaxVolumetricSpeedStartPage::create_page(wxWindow* parent)
m_top_sizer->Add(m_when_content);
m_top_sizer->AddSpacer(PRESET_GAP);
auto recommend_title = new wxStaticText(parent, wxID_ANY, _L("Max Volumetric Speed calibration is recommended when you print with:"));
auto recommend_title = new Label(parent, _L("Max Volumetric Speed calibration is recommended when you print with:"));
recommend_title->SetFont(Label::Head_14);
recommend_title->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
m_top_sizer->Add(recommend_title);
auto recommend_text1 = new wxStaticText(parent, wxID_ANY, _L("material with significant thermal shrinkage/expansion, such as..."));
auto recommend_text1 = new Label(parent, _L("material with significant thermal shrinkage/expansion, such as..."));
recommend_text1->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
recommend_text1->SetFont(Label::Body_14);
m_top_sizer->Add(recommend_text1);
auto recommend_text2 = new wxStaticText(parent, wxID_ANY, _L("materials with inaccurate filament diameter"));
auto recommend_text2 = new Label(parent, _L("materials with inaccurate filament diameter"));
recommend_text2->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
recommend_text2->SetFont(Label::Body_14);
m_top_sizer->Add(recommend_text2);

View file

@ -21,10 +21,10 @@ protected:
wxBoxSizer* m_top_sizer;
wxBoxSizer* m_images_sizer;
wxStaticText* m_when_title;
wxStaticText* m_when_content;
wxStaticText* m_about_title;
wxStaticText* m_about_content;
Label* m_when_title;
Label* m_when_content;
Label* m_about_title;
Label* m_about_content;
wxStaticBitmap* m_before_bmp{ nullptr };
wxStaticBitmap* m_after_bmp{ nullptr };
wxStaticBitmap* m_bmp_intro{ nullptr };

View file

@ -1962,6 +1962,7 @@ void MainFrame::on_dpi_changed(const wxRect& suggested_rect)
m_param_panel->msw_rescale();
m_project->msw_rescale();
m_monitor->msw_rescale();
m_calibration->msw_rescale();
// BBS
#if 0
@ -2020,6 +2021,7 @@ void MainFrame::on_sys_color_changed()
// update Plater
wxGetApp().plater()->sys_color_changed();
m_monitor->on_sys_color_changed();
m_calibration->on_sys_color_changed();
// update Tabs
for (auto tab : wxGetApp().tabs_list)
tab->sys_color_changed();