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
+32 -29
+32 -29
View File
@@ -8049,24 +8049,20 @@ fn tab_view(
let inactive_bg = colors[ColorOption::SidebarBackground.index()];
let outline = colors[ColorOption::ActiveTabOutline.index()];
let title_button = button(
container(text(fit_title(&title)).size(15))
let title_color = if active {
text_color
} else {
text_color.scale_alpha(0.6)
};
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))
.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
} else {
text_color.scale_alpha(0.6)
};
style
});
.on_press(Message::SelectTab(window, tab));
let close_icon = |padding: Padding| {
button(text("×").size(15))
@@ -8198,18 +8194,21 @@ fn drag_ghost(
});
Some(
container(ghost)
.width(Length::Fill)
.height(Length::Fill)
.align_x(Alignment::Start)
.align_y(Alignment::Start)
.padding(Padding {
top: y,
left: x,
right: 0.0,
bottom: 0.0,
})
.into(),
mouse_area(
container(ghost)
.width(Length::Fill)
.height(Length::Fill)
.align_x(Alignment::Start)
.align_y(Alignment::Start)
.padding(Padding {
top: y,
left: x,
right: 0.0,
bottom: 0.0,
}),
)
.interaction(mouse::Interaction::Grabbing)
.into(),
)
}
@@ -11900,9 +11899,13 @@ impl canvas::Program<Message> for TerminalCanvas<'_> {
fn mouse_interaction(
&self,
dragging: &Self::State,
_bounds: Rectangle,
_cursor: mouse::Cursor,
bounds: Rectangle,
cursor: mouse::Cursor,
) -> mouse::Interaction {
if !cursor.is_over(bounds) {
return mouse::Interaction::None;
}
if *dragging {
mouse::Interaction::Grabbing
} else {