QoL: Make sidebar collapsible, resizable, movable, floatable and dockable (#2972)

* Add sidebar docking

* Fix sidebar initial size

* Fix sidebar collapse

* Hide floating sidebar when switch away from model view

* Add option to reset window layout

* Save & load window layout

* Fix a small issue with gcode toggle

* Properly save & restore sidebar state

* Show collapse icon based on sidebar docking state

* Adjust toolbar position based on docking position

* Fix return toolbar position

* Fix plate list position
This commit is contained in:
Noisyfox 2023-12-08 17:16:16 +08:00 committed by GitHub
parent 3d2ab8e2e2
commit 7cfa4f3bcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 317 additions and 119 deletions

View file

@ -122,6 +122,11 @@ class Sidebar : public wxPanel
{
ConfigOptionMode m_mode;
public:
enum DockingState
{
None, Left, Right
};
Sidebar(Plater *parent);
Sidebar(Sidebar &&) = delete;
Sidebar(const Sidebar &) = delete;
@ -313,8 +318,13 @@ public:
bool is_view3D_overhang_shown() const;
void show_view3D_overhang(bool show);
bool is_sidebar_enabled() const;
void enable_sidebar(bool enabled);
bool is_sidebar_collapsed() const;
void collapse_sidebar(bool show);
void collapse_sidebar(bool collapse);
Sidebar::DockingState get_sidebar_docking_state() const;
void reset_window_layout();
// Called after the Preferences dialog is closed and the program settings are saved.
// Update the UI based on the current preferences.
@ -541,7 +551,6 @@ public:
#endif
bool init_collapse_toolbar();
void enable_collapse_toolbar(bool enable);
const Camera& get_camera() const;
Camera& get_camera();