mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 08:35:28 +00:00
replace single_click_activate with custom GestureClick controller
This commit is contained in:
parent
dcaa671ac1
commit
c09e1ae722
1 changed files with 10 additions and 1 deletions
|
|
@ -63,7 +63,6 @@ impl Suggestion {
|
|||
let list_view = {
|
||||
let lv = ListView::builder()
|
||||
.name(format!("s{}", gtk::glib::uuid_string_random()))
|
||||
.single_click_activate(true)
|
||||
.valign(Align::Start)
|
||||
.model(&single_selection)
|
||||
.factory(&{
|
||||
|
|
@ -101,6 +100,16 @@ impl Suggestion {
|
|||
f
|
||||
})
|
||||
.build();
|
||||
lv.add_controller({
|
||||
let c = gtk::GestureClick::builder()
|
||||
.button(gtk::gdk::BUTTON_PRIMARY)
|
||||
.build();
|
||||
c.connect_released({
|
||||
let request = request.clone();
|
||||
move |_, _, _, _| request.emit_activate()
|
||||
});
|
||||
c
|
||||
});
|
||||
lv.connect_activate({
|
||||
let request = request.clone();
|
||||
move |_, _| request.emit_activate()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue