url_row: Use activatable instead of a gesture

This gives highlight on mouse over.
This commit is contained in:
Maximiliano Sandoval R 2023-09-13 23:46:25 +02:00
parent 64cc9a8d3d
commit ca96e2da0d
Failed to generate hash of commit

View file

@ -31,8 +31,8 @@ mod imp {
fn constructed(&self) {
self.parent_constructed();
let obj = self.obj();
let gesture = gtk::GestureClick::new();
gesture.connect_pressed(clone!(@weak obj as row => move |_,_,_,_| {
obj.set_activatable(true);
obj.connect_activated(clone!(@weak obj as row => move |_| {
if let Some(uri) = row.imp().uri.borrow().clone() {
spawn(async move {
let file = gio::File::for_uri(&uri);
@ -44,8 +44,6 @@ mod imp {
};
}));
obj.add_controller(gesture);
let image_suffix = gtk::Image::from_icon_name("link-symbolic");
image_suffix.add_css_class("dim-label");
image_suffix.set_accessible_role(gtk::AccessibleRole::Presentation);