mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
implement progress fraction update
This commit is contained in:
parent
85629e9dcb
commit
2d160b5a49
3 changed files with 14 additions and 5 deletions
|
|
@ -388,8 +388,16 @@ impl Page {
|
||||||
|
|
||||||
pub fn update(&self) {
|
pub fn update(&self) {
|
||||||
// Interpret status to progress fraction
|
// Interpret status to progress fraction
|
||||||
// @TODO
|
let progress_fraction = match self.meta.borrow().status {
|
||||||
self.navigation.update();
|
Some(Status::Prepare) => 0.25,
|
||||||
|
Some(Status::Connect) => 0.50,
|
||||||
|
Some(Status::Request) => 0.75,
|
||||||
|
Some(Status::Response) => 1.0,
|
||||||
|
_ => 0.0,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Update components
|
||||||
|
self.navigation.update(progress_fraction);
|
||||||
// @TODO self.content.update();
|
// @TODO self.content.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,11 +71,11 @@ impl Navigation {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
pub fn update(&self) {
|
pub fn update(&self, progress_fraction: f64) {
|
||||||
self.base.update(self.request.uri());
|
self.base.update(self.request.uri());
|
||||||
self.history.update();
|
self.history.update();
|
||||||
self.reload.update(!self.request.is_empty());
|
self.reload.update(!self.request.is_empty());
|
||||||
self.request.update();
|
self.request.update(progress_fraction);
|
||||||
self.bookmark.update();
|
self.bookmark.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,8 @@ impl Request {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
pub fn update(&self) {
|
pub fn update(&self, progress_fraction: f64) {
|
||||||
|
self.widget.set_progress_fraction(progress_fraction);
|
||||||
// @TODO animate progress fraction
|
// @TODO animate progress fraction
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue