Fix some pane button issues

This commit is contained in:
K Simmons 2022-09-11 15:52:09 -07:00
parent 444417203b
commit 1dfa711d2e
2 changed files with 9 additions and 18 deletions

View file

@ -1048,7 +1048,7 @@ impl Pane {
}); });
} }
fn render_tab_bar(&mut self, cx: &mut RenderContext<Self>) -> impl Element { fn render_tabs(&mut self, cx: &mut RenderContext<Self>) -> impl Element {
let theme = cx.global::<Settings>().theme.clone(); let theme = cx.global::<Settings>().theme.clone();
let filler_index = self.items.len(); let filler_index = self.items.len();
@ -1366,10 +1366,11 @@ impl View for Pane {
if let Some(active_item) = self.active_item() { if let Some(active_item) = self.active_item() {
Flex::column() Flex::column()
.with_child({ .with_child({
let mut tab_row = Flex::row().with_child( let mut tab_row = Flex::row()
self.render_tab_bar(cx).flex(1., true).named("tabs"), .with_child(self.render_tabs(cx).flex(1., true).named("tabs"));
);
// Render pane buttons
let theme = cx.global::<Settings>().theme.clone();
if self.is_active { if self.is_active {
tab_row.add_child( tab_row.add_child(
Flex::row() Flex::row()
@ -1420,24 +1421,16 @@ impl View for Pane {
}) })
})) }))
.contained() .contained()
.with_style( .with_style(theme.workspace.tab_bar.container)
cx.global::<Settings>()
.theme
.workspace
.tab_bar
.pane_button
.default
.container,
)
.boxed(), .boxed(),
) )
} }
tab_row tab_row
.constrained() .constrained()
.with_height( .with_height(theme.workspace.tab_bar.height)
cx.global::<Settings>().theme.workspace.tab_bar.height, .contained()
) .with_style(theme.workspace.tab_bar.container)
.named("tab bar") .named("tab bar")
}) })
.with_child(ChildView::new(&self.toolbar).boxed()) .with_child(ChildView::new(&self.toolbar).boxed())
@ -1519,7 +1512,6 @@ fn tab_bar_button<A: Action>(
.constrained() .constrained()
.with_width(style.icon_width) .with_width(style.icon_width)
.aligned() .aligned()
.contained()
.constrained() .constrained()
.with_width(style.button_width) .with_width(style.button_width)
.with_height(style.button_width) .with_height(style.button_width)

View file

@ -96,7 +96,6 @@ export default function tabBar(theme: Theme) {
buttonWidth: activePaneActiveTab.height, buttonWidth: activePaneActiveTab.height,
hover: { hover: {
color: iconColor(theme, "active"), color: iconColor(theme, "active"),
background: backgroundColor(theme, 300),
}, },
}, },
} }