mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-10-03 16:01:59 +00:00
fix(sidebar): back a tab's hover close button for the row's full height
On a two-line row the diff count sits below the close button's band, and the bottom of '+2' showed under the ×.
This commit is contained in:
+12
-9
@@ -1102,23 +1102,26 @@ impl Tty7App {
|
||||
let mut fade_from = backing;
|
||||
fade_from.a = 0.;
|
||||
row.child(
|
||||
// The row's full height, not the button's: on a
|
||||
// two-line row the diff count sits under the
|
||||
// button's band, and a band-high backing left the
|
||||
// bottom of "+2" showing beneath the ×.
|
||||
h_flex()
|
||||
.absolute()
|
||||
.top(px((row_h - crate::ui::tab_strip::MIN_TARGET) / 2.))
|
||||
.top_0()
|
||||
.bottom_0()
|
||||
.right(px(6.))
|
||||
.opacity(0.)
|
||||
.group_hover(SharedString::from(format!("tab-row-{i}")), |s| {
|
||||
s.opacity(1.)
|
||||
})
|
||||
.child(div().w(px(10.)).h(px(crate::ui::tab_strip::MIN_TARGET)).bg(
|
||||
linear_gradient(
|
||||
90.,
|
||||
linear_color_stop(fade_from, 0.),
|
||||
linear_color_stop(backing, 1.),
|
||||
),
|
||||
))
|
||||
.child(div().w(px(10.)).h_full().bg(linear_gradient(
|
||||
90.,
|
||||
linear_color_stop(fade_from, 0.),
|
||||
linear_color_stop(backing, 1.),
|
||||
)))
|
||||
.child(
|
||||
div().bg(backing).child(
|
||||
div().h_full().flex().items_center().bg(backing).child(
|
||||
crate::ui::tab_strip::hit_target(
|
||||
Button::new(("sidebar-close", i))
|
||||
.icon(IconName::Close)
|
||||
|
||||
Reference in New Issue
Block a user