This commit is contained in:
2026-10-30 21:03:06 +07:00
parent 1711ce0e9d
commit dacdd84aa4
6 changed files with 36 additions and 31 deletions
+7 -5
View File
@@ -7,7 +7,7 @@ use gpui::{
Styled as _, Window, div,
};
use gpui_native_icons::{IconRole, icon};
use gpui_native_theme::{ActiveTheme as _, Theme};
use gpui_native_theme::ActiveTheme as _;
use gpui_native_utils::adjacent_selectable;
/// The change reporter, fired with the next selected tab by pointer and keys.
@@ -133,7 +133,7 @@ impl RenderOnce for Tabs {
.enumerate()
.map(|(index, tab)| {
render_tab(
theme,
cx,
tab,
index,
self.selected == index,
@@ -181,7 +181,7 @@ impl RenderOnce for Tabs {
}
fn render_tab(
theme: &Theme,
cx: &App,
tab: &Tab,
index: usize,
selected: bool,
@@ -189,6 +189,7 @@ fn render_tab(
on_change: &Option<ChangeHandler>,
focus: &gpui::FocusHandle,
) -> AnyElement {
let theme = cx.theme();
let label_color = if tab.disabled {
theme.colors.muted_foreground
} else if selected {
@@ -229,7 +230,7 @@ fn render_tab(
)
}),
)
.child(strip_tab_label(tab.label.clone(), selected, theme));
.child(strip_tab_label(tab.label.clone(), selected, cx));
if !tab.disabled {
strip_tab = strip_tab.cursor_pointer().on_click({
@@ -249,7 +250,8 @@ fn render_tab(
strip_tab.into_any_element()
}
fn strip_tab_label(label: SharedString, selected: bool, theme: &Theme) -> AnyElement {
fn strip_tab_label(label: SharedString, selected: bool, cx: &App) -> AnyElement {
let theme = cx.theme();
div()
.text_color(if selected {
theme.ramps.primary.base