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