delegate event implementation to label, fix target for label click controller

This commit is contained in:
yggverse 2024-10-08 03:20:55 +03:00
parent 22d8d147e3
commit 94d56fec4a
2 changed files with 46 additions and 20 deletions

View file

@ -11,8 +11,7 @@ use sqlite::Transaction;
use gtk::{
gio::SimpleAction,
glib::{uuid_string_random, GString},
prelude::WidgetExt,
Box, GestureClick,
Box,
};
use std::sync::Arc;
@ -56,21 +55,6 @@ impl Item {
action_update.clone(),
));
// Init additional label actions @TODO move to Label?
let controller = GestureClick::new();
controller.connect_pressed({
let label = label.clone();
move |_, count, _, _| {
// double click
if count == 2 {
label.pin(!label.is_pinned()); // toggle
}
}
});
label.gobject().add_controller(controller);
// Return struct
Self {
id,