New Layouts: There 3 mode of a layout of the settings tabpanel :

1. Old mode, as it was always.
2. New mode, when Settings Tabs are hidden on the Plater. Use "cog" icon for the switching to the settings tabs
3. Dlg mode, when Settings Tabs are extracted to the Settings dialog. Use "cog" icon for Show or Focus the Settings Dialog

The "Collapse sidebar" toolbar appearance is set in the Preferences.
This commit is contained in:
YuSanka 2020-05-04 22:30:38 +02:00
parent 5679438e64
commit 10d530a57e
9 changed files with 241 additions and 101 deletions

View file

@ -43,6 +43,22 @@ struct PresetTab {
PrinterTechnology technology;
};
// ----------------------------------------------------------------------------
// SettingsDialog
// ----------------------------------------------------------------------------
class SettingsDialog : public DPIDialog
{
wxNotebook* m_tabpanel { nullptr };
public:
SettingsDialog();
~SettingsDialog() {}
wxNotebook* get_tabpanel() { return m_tabpanel; }
protected:
void on_dpi_changed(const wxRect& suggested_rect) override;
};
class MainFrame : public DPIFrame
{
bool m_loaded {false};
@ -57,6 +73,8 @@ class MainFrame : public DPIFrame
PrintHostQueueDialog *m_printhost_queue_dlg;
size_t m_last_selected_tab {1};
std::string get_base_name(const wxString &full_name, const char *extension = nullptr) const;
std::string get_dir_name(const wxString &full_name) const;
@ -94,6 +112,12 @@ class MainFrame : public DPIFrame
wxFileHistory m_recent_projects;
enum SettingsLayout {
slOld = 0,
slNew,
slDlg,
} m_layout;
protected:
virtual void on_dpi_changed(const wxRect &suggested_rect);
@ -109,7 +133,6 @@ public:
void update_title();
void init_tabpanel();
void switch_to(bool plater);
void create_preset_tabs();
void add_created_tab(Tab* panel);
void init_menubar();
@ -130,7 +153,9 @@ public:
void export_configbundle();
void load_configbundle(wxString file = wxEmptyString);
void load_config(const DynamicPrintConfig& config);
void select_tab(size_t tab);
// Select tab in m_tabpanel
// When tab == -1, will be selected last selected tab
void select_tab(size_t tab = size_t(-1));
void select_view(const std::string& direction);
// Propagate changed configuration from the Tab to the Plater and save changes to the AppConfig
void on_config_changed(DynamicPrintConfig* cfg) const ;
@ -141,6 +166,7 @@ public:
Plater* m_plater { nullptr };
wxNotebook* m_tabpanel { nullptr };
SettingsDialog* m_settings_dialog { nullptr };
wxProgressDialog* m_progress_dialog { nullptr };
std::shared_ptr<ProgressStatusBar> m_statusbar;