init update action

This commit is contained in:
yggverse 2024-09-24 23:08:40 +03:00
parent 68a97fdc88
commit ae3cc7a7d5
14 changed files with 91 additions and 27 deletions

View file

@ -1,17 +1,23 @@
mod content;
mod navigation;
use content::Content;
use navigation::Navigation;
use gtk::{glib::GString, prelude::BoxExt, Box, Orientation};
pub struct Page {
widget: Box,
navigation: Navigation,
content: Content,
}
impl Page {
// Construct
pub fn new(name: GString) -> Page {
// Init components
let navigation = navigation::Navigation::new();
let content = content::Content::new();
let content = Content::new();
let navigation = Navigation::new();
// Init widget
let widget = Box::builder()
@ -23,7 +29,17 @@ impl Page {
widget.append(content.widget());
// Result
Self { widget }
Self {
widget,
content,
navigation,
}
}
// Actions
pub fn update(&self) {
self.navigation.update();
// @TODO self.content.update();
}
// Getters

View file

@ -19,7 +19,7 @@ impl Base {
// Actions
pub fn update(&self) {
todo!()
// @TODO
}
// Getters

View file

@ -19,7 +19,7 @@ impl Bookmark {
// Actions
pub fn update(&self) {
todo!()
// @TODO
}
// Getters

View file

@ -19,7 +19,7 @@ impl Back {
// Actions
pub fn update(&self) {
todo!()
// @TODO
}
// Getters

View file

@ -18,7 +18,7 @@ impl Forward {
// Actions
pub fn update(&self) {
todo!()
// @TODO
}
// Getters

View file

@ -48,6 +48,9 @@ impl Navigation {
widget.append(request.widget());
widget.append(bookmark.widget());
// Connect events
// request.widget().connect_changed({ |_, _, _| {} });
// Result
Self {
widget,

View file

@ -19,7 +19,7 @@ impl Reload {
// Actions
pub fn update(&self) {
todo!()
// @TODO
}
// Getters

View file

@ -18,7 +18,7 @@ impl Request {
// Actions
pub fn update(&self) {
todo!()
// @TODO
}
// Getters