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 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)) 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) .width(Length::Fill)
.padding(padding)
.clip(true)
.align_x(Alignment::Center), .align_x(Alignment::Center),
) )
.on_press(Message::SelectTab(window, tab)) .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
});
let close_icon = |padding: Padding| { let close_icon = |padding: Padding| {
button(text("×").size(15)) button(text("×").size(15))
@@ -8198,18 +8194,21 @@ fn drag_ghost(
}); });
Some( Some(
container(ghost) mouse_area(
.width(Length::Fill) container(ghost)
.height(Length::Fill) .width(Length::Fill)
.align_x(Alignment::Start) .height(Length::Fill)
.align_y(Alignment::Start) .align_x(Alignment::Start)
.padding(Padding { .align_y(Alignment::Start)
top: y, .padding(Padding {
left: x, top: y,
right: 0.0, left: x,
bottom: 0.0, right: 0.0,
}) bottom: 0.0,
.into(), }),
)
.interaction(mouse::Interaction::Grabbing)
.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 {