FIX:fixed the blocking module of linux

Change-Id: I06b357f9592631a729208514a3239f944a98cc96
This commit is contained in:
Tao Wang 2022-09-21 19:44:18 +08:00 committed by Lane.Wei
parent 851b6d6304
commit 6633ef4acf
9 changed files with 59 additions and 36 deletions

View File

@ -170,6 +170,7 @@ int CLI::run(int argc, char **argv)
if (start_gui) { if (start_gui) {
BOOST_LOG_TRIVIAL(info) << "no action, start gui directly" << std::endl; BOOST_LOG_TRIVIAL(info) << "no action, start gui directly" << std::endl;
::Label::initSysFont();
#ifdef SLIC3R_GUI #ifdef SLIC3R_GUI
/*#if !defined(_WIN32) && !defined(__APPLE__) /*#if !defined(_WIN32) && !defined(__APPLE__)
// likely some linux / unix system // likely some linux / unix system

View File

@ -36,10 +36,6 @@ BBLStatusBarBind::BBLStatusBarBind(wxWindow *parent, int id)
m_prog = new wxGauge(m_self, wxID_ANY, 100, wxDefaultPosition, wxSize(m_self->FromDIP(400), m_self->FromDIP(6)), wxGA_HORIZONTAL); m_prog = new wxGauge(m_self, wxID_ANY, 100, wxDefaultPosition, wxSize(m_self->FromDIP(400), m_self->FromDIP(6)), wxGA_HORIZONTAL);
m_prog->SetValue(0); m_prog->SetValue(0);
block_left = new wxWindow(m_prog, wxID_ANY, wxPoint(0, 0), wxSize(2, m_prog->GetSize().GetHeight() * 2));
block_left->SetBackgroundColour(wxColour(255, 255, 255));
block_right = new wxWindow(m_prog, wxID_ANY, wxPoint(m_prog->GetSize().GetWidth() - 2, 0), wxSize(2, m_prog->GetSize().GetHeight() * 2));
block_right->SetBackgroundColour(wxColour(255, 255, 255));
m_stext_percent = new wxStaticText(m_self, wxID_ANY, _L(""), wxDefaultPosition, wxDefaultSize, 0); m_stext_percent = new wxStaticText(m_self, wxID_ANY, _L(""), wxDefaultPosition, wxDefaultSize, 0);
m_stext_percent->SetForegroundColour(wxColour(107, 107, 107)); m_stext_percent->SetForegroundColour(wxColour(107, 107, 107));
@ -61,8 +57,6 @@ BBLStatusBarBind::BBLStatusBarBind(wxWindow *parent, int id)
void BBLStatusBarBind::set_prog_block() void BBLStatusBarBind::set_prog_block()
{ {
block_left->SetPosition(wxPoint(0, 0));
block_right->SetPosition(wxPoint(m_prog->GetSize().GetWidth() - 2, 0));
} }
int BBLStatusBarBind::get_progress() const int BBLStatusBarBind::get_progress() const

View File

@ -35,8 +35,6 @@ class BBLStatusBarBind : public ProgressIndicator
wxStaticText *m_stext_percent; wxStaticText *m_stext_percent;
wxBoxSizer * m_sizer; wxBoxSizer * m_sizer;
wxBoxSizer * m_sizer_eline; wxBoxSizer * m_sizer_eline;
wxWindow * block_left;
wxWindow * block_right;
public: public:
BBLStatusBarBind(wxWindow *parent = nullptr, int id = -1); BBLStatusBarBind(wxWindow *parent = nullptr, int id = -1);

View File

@ -3353,12 +3353,9 @@ void ObjectTableDialog::OnClose(wxCloseEvent &evt)
delete m_obj_panel; delete m_obj_panel;
m_obj_panel = nullptr; m_obj_panel = nullptr;
} }
DestroyChildren(); DestroyChildren();
Destroy(); Destroy();
#endif #else
#ifdef __WXOSX_MAC__
evt.Skip(); evt.Skip();
#endif #endif
} }

View File

@ -319,6 +319,13 @@ void MonitorPanel::on_printer_clicked(wxMouseEvent &event)
wxPoint pos = m_side_tools->ClientToScreen(wxPoint(0, 0)); wxPoint pos = m_side_tools->ClientToScreen(wxPoint(0, 0));
pos.y += m_side_tools->GetRect().height; pos.y += m_side_tools->GetRect().height;
m_select_machine.Position(pos, wxSize(0, 0)); m_select_machine.Position(pos, wxSize(0, 0));
#ifdef __linux__
m_select_machine.SetSize(wxSize(m_side_tools->GetSize().x, -1));
m_select_machine.SetMaxSize(wxSize(m_side_tools->GetSize().x, -1));
m_select_machine.SetMinSize(wxSize(m_side_tools->GetSize().x, -1));
#endif
m_select_machine.Popup(); m_select_machine.Popup();
} }
} }

View File

@ -45,7 +45,7 @@ static const wxColour GROUP_STATIC_LINE_COL = wxColour(206, 206, 206);
/* font and foreground colors */ /* font and foreground colors */
static const wxFont PAGE_TITLE_FONT = Label::Body_14; static const wxFont PAGE_TITLE_FONT = Label::Body_14;
static const wxFont GROUP_TITLE_FONT = Label::sysFont(17); //static const wxFont GROUP_TITLE_FONT = Label::sysFont(17);
static wxColour PAGE_TITLE_FONT_COL = wxColour(107, 107, 107); static wxColour PAGE_TITLE_FONT_COL = wxColour(107, 107, 107);
static wxColour GROUP_TITLE_FONT_COL = wxColour(172, 172, 172); static wxColour GROUP_TITLE_FONT_COL = wxColour(172, 172, 172);
@ -1177,7 +1177,7 @@ void StatusPanel::create_tasklist_info()
m_tasklist_caption_sizer = new wxBoxSizer(wxHORIZONTAL); m_tasklist_caption_sizer = new wxBoxSizer(wxHORIZONTAL);
m_text_tasklist_caption = new wxStaticText(this, wxID_ANY, _L("Printing List"), wxDefaultPosition, wxDefaultSize, 0); m_text_tasklist_caption = new wxStaticText(this, wxID_ANY, _L("Printing List"), wxDefaultPosition, wxDefaultSize, 0);
m_text_tasklist_caption->Wrap(-1); m_text_tasklist_caption->Wrap(-1);
m_text_tasklist_caption->SetFont(GROUP_TITLE_FONT); m_text_tasklist_caption->SetFont(Label::Body_16);
m_text_tasklist_caption->SetForegroundColour(GROUP_TITLE_FONT_COL); m_text_tasklist_caption->SetForegroundColour(GROUP_TITLE_FONT_COL);
m_tasklist_caption_sizer->Add(m_text_tasklist_caption, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, GROUP_TITLE_LEFT_MARGIN); m_tasklist_caption_sizer->Add(m_text_tasklist_caption, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, GROUP_TITLE_LEFT_MARGIN);

View File

@ -268,7 +268,8 @@ void Tab::create_preset_tab()
search_sizer->Add(new wxWindow(m_search_item, wxID_ANY, wxDefaultPosition, wxSize(0, 0)), 0, wxEXPAND | wxLEFT, 16); search_sizer->Add(new wxWindow(m_search_item, wxID_ANY, wxDefaultPosition, wxSize(0, 0)), 0, wxEXPAND | wxLEFT, 16);
search_sizer->Add(m_search_input, 1, wxEXPAND | wxALL, wxGetApp().em_unit() / 2); search_sizer->Add(m_search_input, 1, wxEXPAND | wxALL, wxGetApp().em_unit() / 2);
search_sizer->Add(new wxWindow(m_search_input, wxID_ANY, wxDefaultPosition, wxSize(0, 0)), 0, wxEXPAND | wxLEFT, 16); //bbl for linux
//search_sizer->Add(new wxWindow(m_search_input, wxID_ANY, wxDefaultPosition, wxSize(0, 0)), 0, wxEXPAND | wxLEFT, 16);
m_search_item->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { m_search_item->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {

View File

@ -3,12 +3,13 @@
wxFont Label::sysFont(int size, bool bold) wxFont Label::sysFont(int size, bool bold)
{ {
#ifdef __linux__ //#ifdef __linux__
return wxFont{}; // return wxFont{};
#endif //#endif
#ifdef __WIN32__ #ifndef __APPLE__
size = size * 4 / 5; size = size * 4 / 5;
#endif #endif
auto face = wxString::FromUTF8("HarmonyOS Sans SC"); auto face = wxString::FromUTF8("HarmonyOS Sans SC");
wxFont font{size, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, bold ? wxFONTWEIGHT_BOLD : wxFONTWEIGHT_NORMAL, false, face}; wxFont font{size, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, bold ? wxFONTWEIGHT_BOLD : wxFONTWEIGHT_NORMAL, false, face};
font.SetFaceName(face); font.SetFaceName(face);
@ -19,24 +20,46 @@ wxFont Label::sysFont(int size, bool bold)
} }
return font; return font;
} }
wxFont Label::Head_24 = Label::sysFont(24, true); wxFont Label::Head_24;
wxFont Label::Head_20 = Label::sysFont(20, true); wxFont Label::Head_20;
wxFont Label::Head_18 = Label::sysFont(18, true); wxFont Label::Head_18;
wxFont Label::Head_16 = Label::sysFont(16, true); wxFont Label::Head_16;
wxFont Label::Head_15 = Label::sysFont(15, true); wxFont Label::Head_15;
wxFont Label::Head_14 = Label::sysFont(14, true); wxFont Label::Head_14;
wxFont Label::Head_13 = Label::sysFont(13, true); wxFont Label::Head_13;
wxFont Label::Head_12 = Label::sysFont(12, true); wxFont Label::Head_12;
wxFont Label::Head_10 = Label::sysFont(10, true); wxFont Label::Head_10;
wxFont Label::Body_16 = Label::sysFont(16, false); wxFont Label::Body_16;
wxFont Label::Body_15 = Label::sysFont(15, false); wxFont Label::Body_15;
wxFont Label::Body_14 = Label::sysFont(14, false); wxFont Label::Body_14;
wxFont Label::Body_13 = Label::sysFont(13, false); wxFont Label::Body_13;
wxFont Label::Body_12 = Label::sysFont(12, false); wxFont Label::Body_12;
wxFont Label::Body_11 = Label::sysFont(11, false); wxFont Label::Body_11;
wxFont Label::Body_10 = Label::sysFont(10, false); wxFont Label::Body_10;
wxFont Label::Body_9 = Label::sysFont(9, false); wxFont Label::Body_9;
void Label::initSysFont()
{
Head_24 = Label::sysFont(24, true);
Head_20 = Label::sysFont(20, true);
Head_18 = Label::sysFont(18, true);
Head_16 = Label::sysFont(16, true);
Head_15 = Label::sysFont(15, true);
Head_14 = Label::sysFont(14, true);
Head_13 = Label::sysFont(13, true);
Head_12 = Label::sysFont(12, true);
Head_10 = Label::sysFont(10, true);
Body_16 = Label::sysFont(16, false);
Body_15 = Label::sysFont(15, false);
Body_14 = Label::sysFont(14, false);
Body_13 = Label::sysFont(13, false);
Body_12 = Label::sysFont(12, false);
Body_11 = Label::sysFont(11, false);
Body_10 = Label::sysFont(10, false);
Body_9 = Label::sysFont(9, false);
}
wxSize Label::split_lines(wxDC &dc, int width, const wxString &text, wxString &multiline_text) wxSize Label::split_lines(wxDC &dc, int width, const wxString &text, wxString &multiline_text)
{ {

View File

@ -39,6 +39,8 @@ public:
static wxFont Body_11; static wxFont Body_11;
static wxFont Body_9; static wxFont Body_9;
static void initSysFont();
static wxFont sysFont(int size, bool bold = false); static wxFont sysFont(int size, bool bold = false);
static wxSize split_lines(wxDC &dc, int width, const wxString &text, wxString &multiline_text); static wxSize split_lines(wxDC &dc, int width, const wxString &text, wxString &multiline_text);