Enable scrolling in tab bar (#3614)

This PR enables scrolling horizontally in the tab bar.

Currently this requires holding down <kbd>Shift</kbd> for the scroll to
activate. We'll need to look into this.

Scrolling also currently works when there is a split in the editor, as
the non-split view goes down a different rendering path that does not
constrain the pane width, which breaks a number of things.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2023-12-12 16:38:25 -05:00 committed by GitHub
parent d2feaa41a5
commit e489e2e583
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 56 additions and 4 deletions

View file

@ -93,11 +93,10 @@ impl RenderOnce for TabBar {
.id(self.id)
.group("tab_bar")
.track_focus(&self.focus_handle)
.w_full()
.h(rems(HEIGHT_IN_REMS))
.overflow_hidden()
.flex()
.flex_none()
.w_full()
.h(rems(HEIGHT_IN_REMS))
.bg(cx.theme().colors().tab_bar_background)
.child(
h_stack()
@ -125,7 +124,13 @@ impl RenderOnce for TabBar {
.border_b()
.border_color(cx.theme().colors().border),
)
.child(h_stack().id("tabs").z_index(2).children(self.children)),
.child(
h_stack()
.id("tabs")
.z_index(2)
.overflow_x_scroll()
.children(self.children),
),
)
.child(
h_stack()