From 824852248e94259119f8fd2adf8dd5bfbd3b1272 Mon Sep 17 00:00:00 2001 From: Thierry Berger Date: Thu, 21 May 2026 01:20:56 +0200 Subject: [PATCH] add scroll for new project modal --- .gitignore | 2 ++ src/project_select.rs | 27 ++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 72fee43e..05942a8f 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ *.mp4 # Claude Code .claude/ +# jsn +*.jsn/project.jsn \ No newline at end of file diff --git a/src/project_select.rs b/src/project_select.rs index 1f74df40..a2afa26d 100644 --- a/src/project_select.rs +++ b/src/project_select.rs @@ -1567,7 +1567,8 @@ pub fn open_new_project_modal(world: &mut World, preset: TemplatePreset) { )) .id(); - let card = world + // Modal card root + let card_root = world .spawn(( Node { flex_direction: FlexDirection::Column, @@ -1575,8 +1576,10 @@ pub fn open_new_project_modal(world: &mut World, preset: TemplatePreset) { padding: UiRect::all(Val::Px(18.0)), min_width: Val::Px(560.0), max_width: Val::Px(680.0), + max_height: Val::Percent(90.0), border: UiRect::all(Val::Px(1.0)), border_radius: BorderRadius::all(Val::Px(tokens::BORDER_RADIUS_LG)), + overflow: Overflow::clip(), ..Default::default() }, BackgroundColor(tokens::PANEL_BG), @@ -1584,7 +1587,29 @@ pub fn open_new_project_modal(world: &mut World, preset: TemplatePreset) { ChildOf(scrim), )) .id(); + // Inner scroll container. + let card = world + .spawn(( + Node { + flex_direction: FlexDirection::Column, + row_gap: Val::Px(12.0), + padding: UiRect::all(Val::Px(24.0)), + min_width: Val::Px(420.0), + max_width: Val::Px(520.0), + overflow: Overflow::scroll_y(), + ..Default::default() + }, + ScrollPosition::default(), + bevy::picking::hover::Hovered::default(), + ChildOf(card_root), + )) + .id(); + world.spawn(( + jackdaw_feathers::scroll::scrollbar(card), + ChildOf(card_root), + )); + // Heading world.spawn(( Node { flex_direction: FlexDirection::Row,