add muted_hover token and rework tab strip visuals

This commit is contained in:
2026-11-02 17:08:51 +07:00
parent 545d0986ed
commit f295b25366
10 changed files with 130 additions and 111 deletions
+39 -49
View File
@@ -587,7 +587,7 @@ impl DockState {
}
}
/// The tree the dock renders from, one frame at a time.
/// The tree the dock renders from.
fn snapshot(&self) -> TreeView {
fn snap(node: &Node) -> TreeView {
match node {
@@ -843,7 +843,7 @@ fn render_pane(
content.child(view.cached(StyleRefinement::default().absolute().size_full()))
})
.when(cx.has_active_drag(), |content| {
content.child(render_drop_zones(state, pane))
content.children(render_drop_zones(state, pane))
});
let menu = ContextMenu::new(SharedString::from(format!(
@@ -854,7 +854,6 @@ fn render_pane(
let dock_id = dock_id.clone();
let state = state.clone();
let pane = pane.clone();
let strip_height = metrics.strip_height;
let padding_x = metrics.dense_padding_x;
move |_, _| {
let selected = pane
@@ -922,15 +921,13 @@ fn render_pane(
}
});
// Chrome-less like the future titlebar: the pills carry the look.
// Chrome-less like the future titlebar: the bar wraps the pills.
h_flex()
.flex_none()
.h(strip_height)
.w_full()
.items_center()
.pr(padding_x)
.child(tabs)
.child(div().flex_1())
.into_any_element()
}
})
@@ -982,56 +979,49 @@ fn render_pane(
///
/// - Four edge bands that split
/// - The center that moves the tab in.
fn render_drop_zones(state: &Entity<DockState>, pane: &PaneView) -> AnyElement {
fn render_drop_zones(state: &Entity<DockState>, pane: &PaneView) -> Vec<AnyElement> {
let Some(anchor) = pane
.active
.clone()
.or_else(|| pane.tabs.first().map(|tab| tab.panel.clone()))
else {
return div().into_any_element();
return Vec::new();
};
div()
.absolute()
.inset_0()
.child(
drop_zone(state, &anchor, Some(SplitDirection::Left))
.absolute()
.top_0()
.bottom_0()
.left_0()
.w(relative(0.25)),
)
.child(
drop_zone(state, &anchor, Some(SplitDirection::Right))
.absolute()
.top_0()
.bottom_0()
.right_0()
.w(relative(0.25)),
)
.child(
drop_zone(state, &anchor, Some(SplitDirection::Top))
.absolute()
.top_0()
.left(relative(0.25))
.right(relative(0.25))
.h(relative(0.25)),
)
.child(
drop_zone(state, &anchor, Some(SplitDirection::Bottom))
.absolute()
.bottom_0()
.left(relative(0.25))
.right(relative(0.25))
.h(relative(0.25)),
)
.child(
drop_zone(state, &anchor, None)
.absolute()
.inset(relative(0.25)),
)
.into_any_element()
vec![
drop_zone(state, &anchor, Some(SplitDirection::Left))
.absolute()
.top_0()
.bottom_0()
.left_0()
.w(relative(0.25))
.into_any_element(),
drop_zone(state, &anchor, Some(SplitDirection::Right))
.absolute()
.top_0()
.bottom_0()
.right_0()
.w(relative(0.25))
.into_any_element(),
drop_zone(state, &anchor, Some(SplitDirection::Top))
.absolute()
.top_0()
.left(relative(0.25))
.right(relative(0.25))
.h(relative(0.25))
.into_any_element(),
drop_zone(state, &anchor, Some(SplitDirection::Bottom))
.absolute()
.bottom_0()
.left(relative(0.25))
.right(relative(0.25))
.h(relative(0.25))
.into_any_element(),
drop_zone(state, &anchor, None)
.absolute()
.inset(relative(0.25))
.into_any_element(),
]
}
/// Renders a drop zone for panel dragging.