fix errors

Signed-off-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
SoftFever 2023-09-29 19:47:06 +08:00
parent b8172316b8
commit 4fd2177625
5 changed files with 30 additions and 31 deletions

View file

@ -876,8 +876,8 @@ void MainFrame::update_title()
void MainFrame::show_publish_button(bool show)
{
m_publish_btn->Show(show);
Layout();
// m_publish_btn->Show(show);
// Layout();
}
void MainFrame::show_calibration_button(bool show)
@ -1461,18 +1461,18 @@ wxBoxSizer* MainFrame::create_side_tools()
m_slice_select = eSlicePlate;
m_print_select = ePrintPlate;
m_publish_btn = new Button(this, _L("Upload"), "bar_publish", 0, FromDIP(16));
// m_publish_btn = new Button(this, _L("Upload"), "bar_publish", 0, FromDIP(16));
m_slice_btn = new SideButton(this, _L("Slice plate"), "");
m_slice_option_btn = new SideButton(this, "", "sidebutton_dropdown", 0, FromDIP(14));
m_print_btn = new SideButton(this, _L("Print plate"), "");
m_print_option_btn = new SideButton(this, "", "sidebutton_dropdown", 0, FromDIP(14));
update_side_button_style();
m_publish_btn->Hide();
// m_publish_btn->Hide();
m_slice_option_btn->Enable();
m_print_option_btn->Enable();
sizer->Add(m_publish_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
sizer->Add(FromDIP(15), 0, 0, 0, 0);
// sizer->Add(m_publish_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
// sizer->Add(FromDIP(15), 0, 0, 0, 0);
sizer->Add(m_slice_option_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
sizer->Add(m_slice_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
sizer->Add(FromDIP(15), 0, 0, 0, 0);
@ -1482,20 +1482,20 @@ wxBoxSizer* MainFrame::create_side_tools()
sizer->Layout();
m_publish_btn->Bind(wxEVT_BUTTON, [this](auto& e) {
CallAfter([this] {
wxGetApp().open_publish_page_dialog();
// m_publish_btn->Bind(wxEVT_BUTTON, [this](auto& e) {
// CallAfter([this] {
// wxGetApp().open_publish_page_dialog();
if (!wxGetApp().getAgent()) {
BOOST_LOG_TRIVIAL(info) << "publish: no agent";
return;
}
// if (!wxGetApp().getAgent()) {
// BOOST_LOG_TRIVIAL(info) << "publish: no agent";
// return;
// }
// record
json j;
NetworkAgent* agent = GUI::wxGetApp().getAgent();
});
});
// // record
// json j;
// NetworkAgent* agent = GUI::wxGetApp().getAgent();
// });
// });
m_slice_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event)
{
@ -1858,12 +1858,12 @@ void MainFrame::update_side_button_style()
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
m_publish_btn->SetMinSize(wxSize(FromDIP(125), FromDIP(24)));
m_publish_btn->SetCornerRadius(FromDIP(12));
m_publish_btn->SetBackgroundColor(m_btn_bg_enable);
m_publish_btn->SetBorderColor(m_btn_bg_enable);
m_publish_btn->SetBackgroundColour(wxColour(59,68,70));
m_publish_btn->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
// m_publish_btn->SetMinSize(wxSize(FromDIP(125), FromDIP(24)));
// m_publish_btn->SetCornerRadius(FromDIP(12));
// m_publish_btn->SetBackgroundColor(m_btn_bg_enable);
// m_publish_btn->SetBorderColor(m_btn_bg_enable);
// m_publish_btn->SetBackgroundColour(wxColour(59,68,70));
// m_publish_btn->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_slice_btn->SetTextLayout(SideButton::EHorizontalOrientation::HO_Left, FromDIP(15));
m_slice_btn->SetCornerRadius(FromDIP(12));