Make vertical tab close (×) buttons reliably hittable
Two issues kept the close button unusable: - The launcher-row close button lacked flex_shrink_0, so on narrow sidebars the title swallowed the 16 px hit target before flex laid it out. - The handler did select_tab(close_id) → close_active_tab(); if the newly-selected tab routed through split-view close logic the call silently no-op'd against the user's intent. Add flex_shrink_0 on both launcher and tab close buttons, and route the click through a new close_tab_by_id helper that calls BrowserCore::close_tab(tab_id) directly.
This commit is contained in:
@@ -271,6 +271,7 @@ impl ElyShell {
|
||||
.id(close_id)
|
||||
.size(px(16.0))
|
||||
.rounded(px(4.0))
|
||||
.flex_shrink_0()
|
||||
.flex()
|
||||
.items_center()
|
||||
.justify_center()
|
||||
@@ -280,11 +281,7 @@ impl ElyShell {
|
||||
.hover(|style| style.bg(rgba(0x281e1414)).text_color(rgb(colors::INK)))
|
||||
.cursor_pointer()
|
||||
.on_click(cx.listener(move |shell, _, window, cx| {
|
||||
// Close the tab without bubbling to the launcher row's
|
||||
// own on_click — otherwise the row tries to re-select
|
||||
// the tab right after we've closed it.
|
||||
shell.select_tab(&close_tab_id, window, cx);
|
||||
shell.close_active_tab(window, cx);
|
||||
shell.close_tab_by_id(&close_tab_id, window, cx);
|
||||
cx.stop_propagation();
|
||||
}))
|
||||
.child(IconName::Close),
|
||||
@@ -386,8 +383,7 @@ impl ElyShell {
|
||||
.hover(|style| style.bg(rgba(0x281e1414)).text_color(rgb(colors::INK)))
|
||||
.cursor_pointer()
|
||||
.on_click(cx.listener(move |shell, _, window, cx| {
|
||||
shell.select_tab(&close_tab_id, window, cx);
|
||||
shell.close_active_tab(window, cx);
|
||||
shell.close_tab_by_id(&close_tab_id, window, cx);
|
||||
cx.stop_propagation();
|
||||
}))
|
||||
.child(IconName::Close),
|
||||
|
||||
Reference in New Issue
Block a user