diff --git a/src/browser/main/tab/page.rs b/src/browser/main/tab/page.rs index 10609e64..fba480d7 100644 --- a/src/browser/main/tab/page.rs +++ b/src/browser/main/tab/page.rs @@ -388,8 +388,16 @@ impl Page { pub fn update(&self) { // Interpret status to progress fraction - // @TODO - self.navigation.update(); + let progress_fraction = match self.meta.borrow().status { + 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(); } diff --git a/src/browser/main/tab/page/navigation.rs b/src/browser/main/tab/page/navigation.rs index 029c81fd..6b59bdfe 100644 --- a/src/browser/main/tab/page/navigation.rs +++ b/src/browser/main/tab/page/navigation.rs @@ -71,11 +71,11 @@ impl Navigation { } // Actions - pub fn update(&self) { + pub fn update(&self, progress_fraction: f64) { self.base.update(self.request.uri()); self.history.update(); self.reload.update(!self.request.is_empty()); - self.request.update(); + self.request.update(progress_fraction); self.bookmark.update(); } diff --git a/src/browser/main/tab/page/navigation/request.rs b/src/browser/main/tab/page/navigation/request.rs index 3835b573..80eb631f 100644 --- a/src/browser/main/tab/page/navigation/request.rs +++ b/src/browser/main/tab/page/navigation/request.rs @@ -41,7 +41,8 @@ impl Request { } // Actions - pub fn update(&self) { + pub fn update(&self, progress_fraction: f64) { + self.widget.set_progress_fraction(progress_fraction); // @TODO animate progress fraction }