mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
connect navigation widget to bookmark action
This commit is contained in:
parent
ad89d08f0f
commit
367b4d017b
3 changed files with 52 additions and 21 deletions
|
|
@ -2,23 +2,35 @@ mod widget;
|
|||
|
||||
use widget::Widget;
|
||||
|
||||
use crate::app::browser::window::action::Action as WindowAction;
|
||||
use std::rc::Rc;
|
||||
|
||||
pub struct Bookmark {
|
||||
window_action: Rc<WindowAction>,
|
||||
widget: Rc<Widget>,
|
||||
}
|
||||
|
||||
impl Bookmark {
|
||||
// Construct
|
||||
pub fn new() -> Self {
|
||||
pub fn new(window_action: Rc<WindowAction>) -> Self {
|
||||
Self {
|
||||
widget: Rc::new(Widget::new()),
|
||||
widget: Rc::new(Widget::new(window_action.clone())),
|
||||
window_action,
|
||||
}
|
||||
}
|
||||
|
||||
// Actions
|
||||
pub fn update(&self) {
|
||||
// @TODO
|
||||
let is_enabled = false; // @TODO DB
|
||||
|
||||
// Update actions
|
||||
self.window_action
|
||||
.bookmark()
|
||||
.gobject()
|
||||
.set_enabled(is_enabled);
|
||||
|
||||
// Update child components
|
||||
self.widget.update(is_enabled);
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue