Fix breadcrumbs to use pointer mouse cursor

This commit is contained in:
Jason Rodney Hansen 2024-08-16 10:33:32 -06:00
parent aebc652006
commit ca9f77a09f

View file

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