draft page reload action

This commit is contained in:
yggverse 2024-09-25 01:14:45 +03:00
parent 4e0ec422ca
commit fd73dc3d7c
7 changed files with 45 additions and 2 deletions

View file

@ -1,4 +1,4 @@
use gtk::{Box, Orientation};
use gtk::{glib::GString, Box, Orientation};
pub struct Content {
widget: Box,
@ -12,6 +12,11 @@ impl Content {
}
}
// Actions
pub fn reload(&self, request_text: GString) {
// @TODO
}
// Getters
pub fn widget(&self) -> &Box {
&self.widget

View file

@ -37,6 +37,10 @@ impl Page {
}
// Actions
pub fn reload(&self) {
self.content.reload(self.navigation.request_text());
}
pub fn update(&self) {
self.navigation.update();
// @TODO self.content.update();

View file

@ -10,7 +10,7 @@ use history::History;
use reload::Reload;
use request::Request;
use gtk::{prelude::BoxExt, Box, Orientation};
use gtk::{glib::GString, prelude::BoxExt, Box, Orientation};
pub struct Navigation {
// GTK
@ -72,4 +72,8 @@ impl Navigation {
pub fn widget(&self) -> &Box {
&self.widget
}
pub fn request_text(&self) -> GString {
self.request.text()
}
}

View file

@ -1,4 +1,5 @@
use gtk::{
glib::GString,
prelude::{EditableExt, EntryExt, WidgetExt},
Entry,
};
@ -44,4 +45,8 @@ impl Request {
pub fn is_empty(&self) -> bool {
0 == self.widget.text_length()
}
pub fn text(&self) -> GString {
self.widget.text()
}
}