mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
delegate event implementation to label, fix target for label click controller
This commit is contained in:
parent
22d8d147e3
commit
94d56fec4a
2 changed files with 46 additions and 20 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue