Tech ENABLE_PREVIEW_LAYOUT - Added menu item View/Show legend
This commit is contained in:
parent
fe1c5f34a0
commit
0d922b04af
@ -2422,14 +2422,16 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
|
|||||||
case 'i': { _update_camera_zoom(1.0); break; }
|
case 'i': { _update_camera_zoom(1.0); break; }
|
||||||
case 'K':
|
case 'K':
|
||||||
case 'k': { wxGetApp().plater()->get_camera().select_next_type(); m_dirty = true; break; }
|
case 'k': { wxGetApp().plater()->get_camera().select_next_type(); m_dirty = true; break; }
|
||||||
case 'L':
|
case 'L':
|
||||||
case 'l': {
|
case 'l': {
|
||||||
if (!m_main_toolbar.is_enabled()) {
|
if (!m_main_toolbar.is_enabled()) {
|
||||||
|
#if ENABLE_PREVIEW_LAYOUT
|
||||||
|
show_legend(!is_legend_shown());
|
||||||
|
#else
|
||||||
m_gcode_viewer.enable_legend(!m_gcode_viewer.is_legend_enabled());
|
m_gcode_viewer.enable_legend(!m_gcode_viewer.is_legend_enabled());
|
||||||
m_dirty = true;
|
m_dirty = true;
|
||||||
#if !ENABLE_PREVIEW_LAYOUT
|
|
||||||
wxGetApp().plater()->update_preview_bottom_toolbar();
|
wxGetApp().plater()->update_preview_bottom_toolbar();
|
||||||
#endif // !ENABLE_PREVIEW_LAYOUT
|
#endif // ENABLE_PREVIEW_LAYOUT
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -820,6 +820,11 @@ public:
|
|||||||
bool are_labels_shown() const { return m_labels.is_shown(); }
|
bool are_labels_shown() const { return m_labels.is_shown(); }
|
||||||
void show_labels(bool show) { m_labels.show(show); }
|
void show_labels(bool show) { m_labels.show(show); }
|
||||||
|
|
||||||
|
#if ENABLE_PREVIEW_LAYOUT
|
||||||
|
bool is_legend_shown() const { return m_gcode_viewer.is_legend_enabled(); }
|
||||||
|
void show_legend(bool show) { m_gcode_viewer.enable_legend(show); m_dirty = true; }
|
||||||
|
#endif // ENABLE_PREVIEW_LAYOUT
|
||||||
|
|
||||||
bool is_using_slope() const { return m_slope.is_used(); }
|
bool is_using_slope() const { return m_slope.is_used(); }
|
||||||
void use_slope(bool use) { m_slope.use(use); }
|
void use_slope(bool use) { m_slope.use(use); }
|
||||||
void set_slope_normal_angle(float angle_in_deg) { m_slope.set_normal_angle(angle_in_deg); }
|
void set_slope_normal_angle(float angle_in_deg) { m_slope.set_normal_angle(angle_in_deg); }
|
||||||
|
@ -223,7 +223,7 @@ void KBShortcutsDialog::fill_shortcuts()
|
|||||||
{ "A", L("Horizontal slider - Move active thumb Left") },
|
{ "A", L("Horizontal slider - Move active thumb Left") },
|
||||||
{ "D", L("Horizontal slider - Move active thumb Right") },
|
{ "D", L("Horizontal slider - Move active thumb Right") },
|
||||||
{ "X", L("On/Off one layer mode of the vertical slider") },
|
{ "X", L("On/Off one layer mode of the vertical slider") },
|
||||||
{ "L", L("Show/Hide Legend and Estimated printing time") },
|
{ "L", L("Show/Hide legend") },
|
||||||
{ "C", L("Show/Hide G-code window") },
|
{ "C", L("Show/Hide G-code window") },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1433,6 +1433,11 @@ void MainFrame::init_menubar_as_editor()
|
|||||||
append_menu_check_item(viewMenu, wxID_ANY, _L("Show &labels") + sep + "E", _L("Show object/instance labels in 3D scene"),
|
append_menu_check_item(viewMenu, wxID_ANY, _L("Show &labels") + sep + "E", _L("Show object/instance labels in 3D scene"),
|
||||||
[this](wxCommandEvent&) { m_plater->show_view3D_labels(!m_plater->are_view3D_labels_shown()); }, this,
|
[this](wxCommandEvent&) { m_plater->show_view3D_labels(!m_plater->are_view3D_labels_shown()); }, this,
|
||||||
[this]() { return m_plater->is_view3D_shown(); }, [this]() { return m_plater->are_view3D_labels_shown(); }, this);
|
[this]() { return m_plater->is_view3D_shown(); }, [this]() { return m_plater->are_view3D_labels_shown(); }, this);
|
||||||
|
#if ENABLE_PREVIEW_LAYOUT
|
||||||
|
append_menu_check_item(viewMenu, wxID_ANY, _L("Show legen&d") + sep + "L", _L("Show legend in preview"),
|
||||||
|
[this](wxCommandEvent&) { m_plater->show_legend(!m_plater->is_legend_shown()); }, this,
|
||||||
|
[this]() { return m_plater->is_preview_shown(); }, [this]() { return m_plater->is_legend_shown(); }, this);
|
||||||
|
#endif // ENABLE_PREVIEW_LAYOUT
|
||||||
append_menu_check_item(viewMenu, wxID_ANY, _L("&Collapse sidebar") + sep + "Shift+" + sep_space + "Tab", _L("Collapse sidebar"),
|
append_menu_check_item(viewMenu, wxID_ANY, _L("&Collapse sidebar") + sep + "Shift+" + sep_space + "Tab", _L("Collapse sidebar"),
|
||||||
[this](wxCommandEvent&) { m_plater->collapse_sidebar(!m_plater->is_sidebar_collapsed()); }, this,
|
[this](wxCommandEvent&) { m_plater->collapse_sidebar(!m_plater->is_sidebar_collapsed()); }, this,
|
||||||
[]() { return true; }, [this]() { return m_plater->is_sidebar_collapsed(); }, this);
|
[]() { return true; }, [this]() { return m_plater->is_sidebar_collapsed(); }, this);
|
||||||
@ -1550,6 +1555,12 @@ void MainFrame::init_menubar_as_gcodeviewer()
|
|||||||
if (m_plater != nullptr) {
|
if (m_plater != nullptr) {
|
||||||
viewMenu = new wxMenu();
|
viewMenu = new wxMenu();
|
||||||
add_common_view_menu_items(viewMenu, this, std::bind(&MainFrame::can_change_view, this));
|
add_common_view_menu_items(viewMenu, this, std::bind(&MainFrame::can_change_view, this));
|
||||||
|
#if ENABLE_PREVIEW_LAYOUT
|
||||||
|
viewMenu->AppendSeparator();
|
||||||
|
append_menu_check_item(viewMenu, wxID_ANY, _L("Show legen&d") + sep + "L", _L("Show legend"),
|
||||||
|
[this](wxCommandEvent&) { m_plater->show_legend(!m_plater->is_legend_shown()); }, this,
|
||||||
|
[this]() { return m_plater->is_preview_shown(); }, [this]() { return m_plater->is_legend_shown(); }, this);
|
||||||
|
#endif // ENABLE_PREVIEW_LAYOUT
|
||||||
}
|
}
|
||||||
|
|
||||||
// helpmenu
|
// helpmenu
|
||||||
|
@ -1667,6 +1667,11 @@ struct Plater::priv
|
|||||||
bool are_view3D_labels_shown() const { return (current_panel == view3D) && view3D->get_canvas3d()->are_labels_shown(); }
|
bool are_view3D_labels_shown() const { return (current_panel == view3D) && view3D->get_canvas3d()->are_labels_shown(); }
|
||||||
void show_view3D_labels(bool show) { if (current_panel == view3D) view3D->get_canvas3d()->show_labels(show); }
|
void show_view3D_labels(bool show) { if (current_panel == view3D) view3D->get_canvas3d()->show_labels(show); }
|
||||||
|
|
||||||
|
#if ENABLE_PREVIEW_LAYOUT
|
||||||
|
bool is_legend_shown() const { return (current_panel == preview) && preview->get_canvas3d()->is_legend_shown(); }
|
||||||
|
void show_legend(bool show) { if (current_panel == preview) preview->get_canvas3d()->show_legend(show); }
|
||||||
|
#endif // ENABLE_PREVIEW_LAYOUT
|
||||||
|
|
||||||
bool is_sidebar_collapsed() const { return sidebar->is_collapsed(); }
|
bool is_sidebar_collapsed() const { return sidebar->is_collapsed(); }
|
||||||
void collapse_sidebar(bool collapse);
|
void collapse_sidebar(bool collapse);
|
||||||
|
|
||||||
@ -5410,6 +5415,11 @@ bool Plater::is_view3D_shown() const { return p->is_view3D_shown(); }
|
|||||||
bool Plater::are_view3D_labels_shown() const { return p->are_view3D_labels_shown(); }
|
bool Plater::are_view3D_labels_shown() const { return p->are_view3D_labels_shown(); }
|
||||||
void Plater::show_view3D_labels(bool show) { p->show_view3D_labels(show); }
|
void Plater::show_view3D_labels(bool show) { p->show_view3D_labels(show); }
|
||||||
|
|
||||||
|
#if ENABLE_PREVIEW_LAYOUT
|
||||||
|
bool Plater::is_legend_shown() const { return p->is_legend_shown(); }
|
||||||
|
void Plater::show_legend(bool show) { p->show_legend(show); }
|
||||||
|
#endif // ENABLE_PREVIEW_LAYOUT
|
||||||
|
|
||||||
bool Plater::is_sidebar_collapsed() const { return p->is_sidebar_collapsed(); }
|
bool Plater::is_sidebar_collapsed() const { return p->is_sidebar_collapsed(); }
|
||||||
void Plater::collapse_sidebar(bool show) { p->collapse_sidebar(show); }
|
void Plater::collapse_sidebar(bool show) { p->collapse_sidebar(show); }
|
||||||
|
|
||||||
|
@ -187,6 +187,11 @@ public:
|
|||||||
bool are_view3D_labels_shown() const;
|
bool are_view3D_labels_shown() const;
|
||||||
void show_view3D_labels(bool show);
|
void show_view3D_labels(bool show);
|
||||||
|
|
||||||
|
#if ENABLE_PREVIEW_LAYOUT
|
||||||
|
bool is_legend_shown() const;
|
||||||
|
void show_legend(bool show);
|
||||||
|
#endif // ENABLE_PREVIEW_LAYOUT
|
||||||
|
|
||||||
bool is_sidebar_collapsed() const;
|
bool is_sidebar_collapsed() const;
|
||||||
void collapse_sidebar(bool show);
|
void collapse_sidebar(bool show);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user