Yoda/src/app/browser/window/tab/item/page/navigation/reload.rs
2024-11-14 08:51:14 +02:00

37 lines
715 B
Rust

mod widget;
use widget::Widget;
use crate::app::browser::window::action::Action as WindowAction;
use std::rc::Rc;
pub struct Reload {
action: Rc<WindowAction>,
widget: Rc<Widget>,
}
impl Reload {
// Construct
pub fn new(action: Rc<WindowAction>) -> Self {
Self {
action: action.clone(),
widget: Rc::new(Widget::new(action)),
}
}
// Actions
pub fn update(&self, is_enabled: bool) {
// Update actions
self.action.reload().gobject().set_enabled(is_enabled);
// Update child components
self.widget.update(is_enabled);
}
// Getters
pub fn widget(&self) -> &Rc<Widget> {
&self.widget
}
}