Merge pull request #402 from jasonrhansen/breadcrumbs-mouse-cursor

Use pointer mouse cursor for breadcrumbs
This commit is contained in:
Jeremy Soller 2024-08-19 07:47:45 -06:00 committed by GitHub
commit 7d7f614734
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2105,9 +2105,9 @@ impl Tab {
crate::mouse_area::MouseArea::new(
widget::button(widget::icon::from_name("edit-symbolic").size(16))
.padding(space_xxs)
.style(theme::Button::Icon),
.style(theme::Button::Icon)
.on_press(Message::EditLocation(Some(self.location.clone()))),
)
.on_press(move |_| Message::EditLocation(Some(self.location.clone())))
.on_middle_press(move |_| Message::OpenInNewTab(path.clone())),
);
w += 16.0 + 2.0 * space_xxs as f32;
@ -2207,24 +2207,22 @@ impl Tab {
let mut mouse_area = crate::mouse_area::MouseArea::new(
widget::button(row)
.padding(space_xxxs)
.style(theme::Button::Link),
)
.on_press(move |_| {
Message::Location(match &self.location {
Location::Path(_) => Location::Path(ancestor.to_path_buf()),
Location::Search(_, term) => {
Location::Search(ancestor.to_path_buf(), term.clone())
}
other => other.clone(),
})
});
.style(theme::Button::Link)
.on_press(Message::Location(match &self.location {
Location::Path(_) => Location::Path(ancestor.to_path_buf()),
Location::Search(_, term) => {
Location::Search(ancestor.to_path_buf(), term.clone())
}
other => other.clone(),
})),
);
if self.location_context_menu_index.is_some() {
mouse_area = mouse_area.on_right_press(move |_point_opt| {
Message::LocationContextMenuIndex(None)
})
} else {
mouse_area = mouse_area.on_right_press_no_capture(move |point_opt| {
mouse_area = mouse_area.on_right_press_no_capture(move |_point_opt| {
Message::LocationContextMenuIndex(Some(index))
})
}