mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
fix bookmark update action
This commit is contained in:
parent
d0a7c3079d
commit
feca899c5b
3 changed files with 12 additions and 18 deletions
|
|
@ -6,7 +6,6 @@ use crate::app::browser::window::action::Action as WindowAction;
|
|||
use std::rc::Rc;
|
||||
|
||||
pub struct Bookmark {
|
||||
action: Rc<WindowAction>,
|
||||
widget: Rc<Widget>,
|
||||
}
|
||||
|
||||
|
|
@ -15,17 +14,12 @@ impl Bookmark {
|
|||
pub fn new(action: Rc<WindowAction>) -> Self {
|
||||
Self {
|
||||
widget: Rc::new(Widget::new(action.clone())),
|
||||
action,
|
||||
}
|
||||
}
|
||||
|
||||
// Actions
|
||||
pub fn update(&self, is_enabled: bool) {
|
||||
// Update actions
|
||||
self.action.bookmark().gobject().set_enabled(is_enabled);
|
||||
|
||||
// Update child components
|
||||
self.widget.update(is_enabled);
|
||||
pub fn update(&self, has_bookmark: bool) {
|
||||
self.widget.update(has_bookmark);
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue