Collapse_toolbar: fixed draw items

+ Extended toolbar
This commit is contained in:
YuSanka 2020-04-23 21:00:00 +02:00
parent fcb85dcdc3
commit 1c1a7ed712
2 changed files with 26 additions and 6 deletions

View file

@ -1557,7 +1557,7 @@ GLCanvas3D::GLCanvas3D(wxGLCanvas* canvas, Bed3D& bed, Camera& camera, GLToolbar
#endif // !ENABLE_NON_STATIC_CANVAS_MANAGER
, m_main_toolbar(GLToolbar::Normal, "Top")
, m_undoredo_toolbar(GLToolbar::Normal, "Top")
, m_collapse_toolbar(GLToolbar::Normal, "TopRight")
, m_collapse_toolbar(GLToolbar::Normal, "Top")
, m_gizmos(*this)
, m_use_clipping_planes(false)
, m_sidebar_field("")
@ -5261,14 +5261,12 @@ bool GLCanvas3D::_init_collapse_toolbar()
if (!m_collapse_toolbar.add_item(item))
return false;
if (!m_collapse_toolbar.add_separator())
return false;
item.name = "print";
item.icon_filename = "cog.svg";
item.tooltip = _utf8(L("Switch to Print Settings")) + " [" + GUI::shortkey_ctrl_prefix() + "2]";
item.sprite_id = 1;
item.left.action_callback = [this]() { wxGetApp().mainframe->select_tab(0); };
item.visibility_callback = [this]() { return wxGetApp().plater()->is_sidebar_collapsed(); };
if (!m_collapse_toolbar.add_item(item))
return false;
@ -5278,6 +5276,8 @@ bool GLCanvas3D::_init_collapse_toolbar()
item.tooltip = _utf8(L("Switch to Filament Settings")) + " [" + GUI::shortkey_ctrl_prefix() + "3]";
item.sprite_id = 2;
item.left.action_callback = [this]() { wxGetApp().mainframe->select_tab(1); };
item.visibility_callback = [this]() { return wxGetApp().plater()->is_sidebar_collapsed() &&
wxGetApp().plater()->printer_technology() == ptFFF; };
if (!m_collapse_toolbar.add_item(item))
return false;
@ -5288,6 +5288,26 @@ bool GLCanvas3D::_init_collapse_toolbar()
item.sprite_id = 3;
item.left.action_callback = [this]() { wxGetApp().mainframe->select_tab(2); };
if (!m_collapse_toolbar.add_item(item))
return false;
item.name = "resin";
item.icon_filename = "resin.svg";
item.tooltip = _utf8(L("Switch to SLA Material Settings")) + " [" + GUI::shortkey_ctrl_prefix() + "3]";
item.sprite_id = 4;
item.left.action_callback = [this]() { wxGetApp().mainframe->select_tab(1); };
item.visibility_callback = [this]() { return wxGetApp().plater()->is_sidebar_collapsed() &&
(m_process->current_printer_technology() == ptSLA); };
if (!m_collapse_toolbar.add_item(item))
return false;
item.name = "sla_printer";
item.icon_filename = "sla_printer.svg";
item.tooltip = _utf8(L("Switch to Printer Settings")) + " [" + GUI::shortkey_ctrl_prefix() + "4]";
item.sprite_id = 5;
item.left.action_callback = [this]() { wxGetApp().mainframe->select_tab(2); };
if (!m_collapse_toolbar.add_item(item))
return false;

View file

@ -373,6 +373,8 @@ bool GUI_App::on_init_inner()
if (wxImage::FindHandler(wxBITMAP_TYPE_PNG) == nullptr)
wxImage::AddHandler(new wxPNGHandler());
mainframe = new MainFrame();
mainframe->switch_to(true); // hide settings tabs after first Layout
sidebar().obj_list()->init_objects(); // propagate model objects to object list
// update_mode(); // !!! do that later
SetTopWindow(mainframe);
@ -424,8 +426,6 @@ bool GUI_App::on_init_inner()
update_mode(); // update view mode after fix of the object_list size
mainframe->switch_to(true); // hide settings tabs after mode updating
m_initialized = true;
return true;
}