tabs: simplify selected strip tab styling
This commit is contained in:
@@ -629,11 +629,7 @@ impl Tab {
|
|||||||
.px(metrics.dense_padding_x)
|
.px(metrics.dense_padding_x)
|
||||||
.pr(metrics.plate_inset)
|
.pr(metrics.plate_inset)
|
||||||
.rounded(theme.radius.control)
|
.rounded(theme.radius.control)
|
||||||
.when(selected, |strip_tab| {
|
.when(selected, |strip_tab| strip_tab.bg(theme.colors.muted_hover)),
|
||||||
strip_tab
|
|
||||||
.bg(theme.colors.muted)
|
|
||||||
.hover(|strip_tab| strip_tab.bg(theme.colors.muted_hover))
|
|
||||||
}),
|
|
||||||
})
|
})
|
||||||
.when_some(self.lead.take(), |strip_tab, lead| strip_tab.child(lead))
|
.when_some(self.lead.take(), |strip_tab, lead| strip_tab.child(lead))
|
||||||
.child(self.label.clone())
|
.child(self.label.clone())
|
||||||
|
|||||||
@@ -109,7 +109,10 @@ impl RenderOnce for Panel {
|
|||||||
.flex_1()
|
.flex_1()
|
||||||
.min_w_0()
|
.min_w_0()
|
||||||
.h_full()
|
.h_full()
|
||||||
|
// the titlebar's centered tabs leave slack above the strip's
|
||||||
|
// bottom edge, so the top gutter is narrower to even out.
|
||||||
.p_2()
|
.p_2()
|
||||||
|
.pt_1()
|
||||||
.bg(app_background)
|
.bg(app_background)
|
||||||
.child(row)
|
.child(row)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
use gpui::prelude::FluentBuilder as _;
|
use gpui::prelude::FluentBuilder as _;
|
||||||
use gpui::{
|
use gpui::{
|
||||||
AnyElement, App, ElementId, InteractiveElement as _, IntoElement, ParentElement, RenderOnce,
|
AnyElement, App, ElementId, InteractiveElement as _, IntoElement, ParentElement, RenderOnce,
|
||||||
SharedString, Styled as _, Window, div,
|
SharedString, Styled as _, Window,
|
||||||
};
|
};
|
||||||
use gpui_native_theme::{ActiveTheme as _, Size, TRAFFIC_LIGHT_PAD};
|
use gpui_native_theme::{ActiveTheme as _, Size, TRAFFIC_LIGHT_PAD};
|
||||||
use gpui_native_utils::h_flex;
|
use gpui_native_utils::h_flex;
|
||||||
@@ -80,6 +80,7 @@ impl RenderOnce for Titlebar {
|
|||||||
.flex_none()
|
.flex_none()
|
||||||
.w_full()
|
.w_full()
|
||||||
.h(height)
|
.h(height)
|
||||||
|
.gap_2()
|
||||||
.bg(app_background)
|
.bg(app_background)
|
||||||
.px(padding_x)
|
.px(padding_x)
|
||||||
.when(cfg!(target_os = "macos"), |bar| bar.pl(TRAFFIC_LIGHT_PAD))
|
.when(cfg!(target_os = "macos"), |bar| bar.pl(TRAFFIC_LIGHT_PAD))
|
||||||
@@ -96,12 +97,10 @@ impl RenderOnce for Titlebar {
|
|||||||
})
|
})
|
||||||
.when_some(self.tab_bar, |bar, tab_bar| {
|
.when_some(self.tab_bar, |bar, tab_bar| {
|
||||||
bar.child(
|
bar.child(
|
||||||
div()
|
h_flex()
|
||||||
.flex()
|
|
||||||
.flex_1()
|
.flex_1()
|
||||||
.min_w_0()
|
.min_w_0()
|
||||||
.h_full()
|
.h_full()
|
||||||
.items_center()
|
|
||||||
.overflow_hidden()
|
.overflow_hidden()
|
||||||
.when(cfg!(target_os = "windows"), |slot| slot.occlude())
|
.when(cfg!(target_os = "windows"), |slot| slot.occlude())
|
||||||
.child(tab_bar),
|
.child(tab_bar),
|
||||||
|
|||||||
Reference in New Issue
Block a user