mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-08 08:11:14 +00:00
Make the Design tab sidebar dockable and collapsible like Prepare's
The sidebar can move to either side, float, be resized, and collapse with the canvas button or Shift+Tab. Its layout is remembered separately from Prepare's, starts where Prepare's sidebar is, and View > Reset Window Layout resets both tabs.
This commit is contained in:
@@ -1672,5 +1672,27 @@ float GLToolbar::get_scaled_icon_size()
|
||||
return m_layout.icons_size * m_layout.scale;
|
||||
}
|
||||
|
||||
bool setup_collapse_toolbar(GLToolbar& toolbar, std::function<void()> toggle)
|
||||
{
|
||||
toolbar.set_layout_type(GLToolbar::Layout::Vertical);
|
||||
toolbar.set_horizontal_orientation(GLToolbar::Layout::HO_Right);
|
||||
toolbar.set_vertical_orientation(GLToolbar::Layout::VO_Top);
|
||||
toolbar.set_border(4.0f);
|
||||
toolbar.set_separator_size(4);
|
||||
toolbar.set_gap_size(2);
|
||||
|
||||
toolbar.del_all_item();
|
||||
|
||||
GLToolbarItem::Data item;
|
||||
|
||||
item.name = "collapse_sidebar";
|
||||
// set collapse svg name
|
||||
item.icon_filename = "collapse.svg";
|
||||
item.sprite_id = 0;
|
||||
item.left.action_callback = std::move(toggle);
|
||||
|
||||
return toolbar.add_item(item);
|
||||
}
|
||||
|
||||
} // namespace GUI
|
||||
} // namespace Slic3r
|
||||
|
||||
Reference in New Issue
Block a user