Lift sidebar resize handle outside the rounded clip so it's hittable

The handle was a child of the rounded sidebar panel, which set
overflow_hidden — so the 6 px strip pinned at right(-2) was clipped to
the rounded edge and never reached the cursor. Split the panel into an
outer positioning wrapper plus an inner rounded panel, and place the
handle on the wrapper. Widen the strip to 8 px straddling the edge and
warm the hover tint so the affordance is visible during drag.
This commit is contained in:
2026-05-10 00:46:44 -04:00
parent 5287fccdec
commit 7c33381063
+17 -8
View File
@@ -19,10 +19,16 @@ impl ElyShell {
cx: &mut Context<Self>,
) -> AnyElement {
let panel_color = panel_bg(snapshot);
// Outer wrapper holds the resize handle outside the rounded
// panel's overflow_hidden clip; inner panel keeps the rounded
// glass treatment without swallowing the column-resize column.
div()
.w(px(sidebar_width))
.h_full()
.relative()
.child(
div()
.size_full()
.flex()
.flex_col()
.rounded(px(spacing::RADIUS_CARD))
@@ -60,7 +66,8 @@ impl ElyShell {
.children(self.render_sidebar_tab_rows(snapshot, cx))
.child(self.render_new_tab_row(cx)),
)
.child(self.render_sidebar_footer(snapshot, cx))
.child(self.render_sidebar_footer(snapshot, cx)),
)
.child(render_sidebar_resize_handle(cx))
.into_any_element()
}
@@ -457,18 +464,20 @@ const UNREAD_BADGE_BG: u32 = 0x281e140f;
/// never participates in hit testing.
const HIGHLIGHT_BORDER: u32 = 0xffffff80;
/// Sidebar resize affordance pinned to the panel's right edge. The
/// strip itself is invisible until hovered; on mouse-down it tells the
/// shell to capture the drag origin so window-level mouse-move can
/// compute the live width.
/// Sidebar resize affordance straddling the panel's right edge. The
/// strip lives in the outer wrapper (not the rounded inner panel) so
/// it isn't swallowed by `overflow_hidden`; it spans 4 px outside the
/// panel and 4 px inside, giving the cursor a comfortably wide hit
/// surface that still reads as "edge of the panel" rather than
/// "stripe across the layout".
fn render_sidebar_resize_handle(cx: &mut Context<ElyShell>) -> AnyElement {
div()
.id(SharedString::from("sidebar-resize-handle"))
.absolute()
.top_0()
.bottom_0()
.right(px(-2.0))
.w(px(6.0))
.right(px(-4.0))
.w(px(8.0))
.cursor_col_resize()
.hover(|style| style.bg(rgba(RESIZE_HANDLE_HOVER_BG)))
.on_mouse_down(
@@ -480,7 +489,7 @@ fn render_sidebar_resize_handle(cx: &mut Context<ElyShell>) -> AnyElement {
.into_any_element()
}
const RESIZE_HANDLE_HOVER_BG: u32 = 0xffffff66;
const RESIZE_HANDLE_HOVER_BG: u32 = 0xffaa7733;
/// Maps appearance translucency_pct to a panel rgba u32 tinted by the
/// active wallpaper theme.