fix bookmark update action

This commit is contained in:
yggverse 2024-11-14 08:59:48 +02:00
parent d0a7c3079d
commit feca899c5b
3 changed files with 12 additions and 18 deletions

View file

@ -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