mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
update button on activate action
This commit is contained in:
parent
b3b2763af1
commit
50158c2f64
1 changed files with 11 additions and 0 deletions
|
|
@ -26,6 +26,17 @@ impl Bookmark for Button {
|
|||
.tooltip_text("Bookmark")
|
||||
.build();
|
||||
|
||||
action.bookmark.simple_action.connect_activate({
|
||||
let button = button.clone();
|
||||
let profile = profile.clone();
|
||||
let request = request.clone();
|
||||
move |_, _| {
|
||||
button.set_icon_name(icon_name(
|
||||
profile.bookmark.get(&request.entry.text()).is_ok(),
|
||||
))
|
||||
}
|
||||
}); // @TODO use local action
|
||||
|
||||
button.connect_clicked(move |this| this.set_icon_name(icon_name(has_bookmark)));
|
||||
|
||||
button
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue