Better mouse cursors selection on tabs and tab close areas
Moorly CI / windows-build (push) Successful in 3m27s
Moorly CI / linux-build (push) Successful in 4m10s

This commit is contained in:
Squid committed 2026-11-17 20:44:05 +01:00
1 parent 403cdf8174
commit a85c57c8e7
1 file changed
+20 -17
+20 -17
View File
@@ -8049,24 +8049,20 @@ fn tab_view(
let inactive_bg = colors[ColorOption::SidebarBackground.index()]; let inactive_bg = colors[ColorOption::SidebarBackground.index()];
let outline = colors[ColorOption::ActiveTabOutline.index()]; let outline = colors[ColorOption::ActiveTabOutline.index()];
let title_button = button( let title_color = if active {
container(text(fit_title(&title)).size(15))
.width(Length::Fill)
.align_x(Alignment::Center),
)
.on_press(Message::SelectTab(window, tab))
.padding(padding)
.width(Length::Fill)
.clip(true)
.style(move |theme, status| {
let mut style = button::text(theme, status);
style.text_color = if active {
text_color text_color
} else { } else {
text_color.scale_alpha(0.6) text_color.scale_alpha(0.6)
}; };
style
}); let title_button = mouse_area(
container(text(fit_title(&title)).size(15).color(title_color))
.width(Length::Fill)
.padding(padding)
.clip(true)
.align_x(Alignment::Center),
)
.on_press(Message::SelectTab(window, tab));
let close_icon = |padding: Padding| { let close_icon = |padding: Padding| {
button(text("×").size(15)) button(text("×").size(15))
@@ -8198,6 +8194,7 @@ fn drag_ghost(
}); });
Some( Some(
mouse_area(
container(ghost) container(ghost)
.width(Length::Fill) .width(Length::Fill)
.height(Length::Fill) .height(Length::Fill)
@@ -8208,7 +8205,9 @@ fn drag_ghost(
left: x, left: x,
right: 0.0, right: 0.0,
bottom: 0.0, bottom: 0.0,
}) }),
)
.interaction(mouse::Interaction::Grabbing)
.into(), .into(),
) )
} }
@@ -11900,9 +11899,13 @@ impl canvas::Program<Message> for TerminalCanvas<'_> {
fn mouse_interaction( fn mouse_interaction(
&self, &self,
dragging: &Self::State, dragging: &Self::State,
_bounds: Rectangle, bounds: Rectangle,
_cursor: mouse::Cursor, cursor: mouse::Cursor,
) -> mouse::Interaction { ) -> mouse::Interaction {
if !cursor.is_over(bounds) {
return mouse::Interaction::None;
}
if *dragging { if *dragging {
mouse::Interaction::Grabbing mouse::Interaction::Grabbing
} else { } else {