diff --git a/crates/command_palette/src/command_palette.rs b/crates/command_palette/src/command_palette.rs index 0cd7f581de..c8a98962c9 100644 --- a/crates/command_palette/src/command_palette.rs +++ b/crates/command_palette/src/command_palette.rs @@ -396,6 +396,7 @@ impl PickerDelegate for CommandPaletteDelegate { .child( h_flex() .w_full() + .py_px() .justify_between() .child(HighlightedLabel::new( command.name.clone(), diff --git a/crates/file_finder/src/file_finder.rs b/crates/file_finder/src/file_finder.rs index a8349a6335..5f2c874457 100644 --- a/crates/file_finder/src/file_finder.rs +++ b/crates/file_finder/src/file_finder.rs @@ -880,6 +880,7 @@ impl PickerDelegate for FileFinderDelegate { .child( h_flex() .gap_2() + .py_px() .child(HighlightedLabel::new(file_name, file_name_positions)) .child( HighlightedLabel::new(full_path, full_path_positions) diff --git a/crates/gpui/src/elements/list.rs b/crates/gpui/src/elements/list.rs index f449862668..90dd8da0c2 100644 --- a/crates/gpui/src/elements/list.rs +++ b/crates/gpui/src/elements/list.rs @@ -241,7 +241,7 @@ impl ListState { let mut cursor = state.items.cursor::(); cursor.seek(&Count(ix + 1), Bias::Right, &()); let bottom = cursor.start().height + padding.top; - let goal_top = px(0.).max(bottom - height); + let goal_top = px(0.).max(bottom - height + padding.bottom); cursor.seek(&Height(goal_top), Bias::Left, &()); let start_ix = cursor.start().count; diff --git a/crates/gpui/src/elements/uniform_list.rs b/crates/gpui/src/elements/uniform_list.rs index 8a6651524b..2d708f270e 100644 --- a/crates/gpui/src/elements/uniform_list.rs +++ b/crates/gpui/src/elements/uniform_list.rs @@ -221,10 +221,10 @@ impl Element for UniformList { let item_top = item_height * ix + padding.top; let item_bottom = item_top + item_height; let scroll_top = -updated_scroll_offset.y; - if item_top < scroll_top { - updated_scroll_offset.y = -item_top; - } else if item_bottom > scroll_top + list_height { - updated_scroll_offset.y = -(item_bottom - list_height); + if item_top < scroll_top + padding.top { + updated_scroll_offset.y = -(item_top) + padding.top; + } else if item_bottom > scroll_top + list_height - padding.bottom { + updated_scroll_offset.y = -(item_bottom - list_height) - padding.bottom; } scroll_offset = *updated_scroll_offset; }