mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-01 10:51:11 +01:00
Keep collection panels and their fixed footers in their own viewport
(cherry picked from commitd69f9c041c) (cherry picked from commit20039d741c)
This commit is contained in:
1 parent
2b1d29e57a
commit
8a52ef43bb
1 file changed
+22
-8
@@ -15,14 +15,28 @@ pub(crate) fn panel_body(app: &mut VectorcraftApp, ui: &mut Ui, id: &str) {
|
||||
Some(DockTab::Properties) => panels::properties::show(app, ui),
|
||||
Some(DockTab::Layers) => panels::layers::show(app, ui),
|
||||
Some(DockTab::Libraries) => panels::libraries(app, ui),
|
||||
None => {
|
||||
// The dock clips the group at its assigned height. Keep the panel's own collection
|
||||
// viewport bounded while allowing a form that exceeds that height to scroll.
|
||||
let height = ui.available_height();
|
||||
Stack::new().id_salt(id).fill().scroll(Scroll::vertical()).show(ui, |ui, _| {
|
||||
ui.set_max_height(height);
|
||||
panels::show_icon_panel(app, ui, id);
|
||||
});
|
||||
None if matches!(
|
||||
id,
|
||||
"align"
|
||||
| "attributes"
|
||||
| "blend"
|
||||
| "character"
|
||||
| "color"
|
||||
| "magicWand"
|
||||
| "openType"
|
||||
| "paragraph"
|
||||
| "pathfinder"
|
||||
| "patternOptions"
|
||||
| "stroke"
|
||||
| "tabs"
|
||||
| "transform"
|
||||
| "transparency"
|
||||
) =>
|
||||
{
|
||||
// These panels lay out forms. Collection panels own their scrolling viewport
|
||||
// and reserve their own footer outside it.
|
||||
Stack::new().id_salt(id).fill().scroll(Scroll::vertical()).show(ui, |ui, _| panels::show_icon_panel(app, ui, id));
|
||||
}
|
||||
None => panels::show_icon_panel(app, ui, id),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user