mirror of
https://github.com/servo/servo.git
synced 2025-08-15 18:35:33 +01:00
libservo: Combine LoadStart,
HeadParsed, and
LoadComplete` messages (#35260)
These will be a single method in the upcoming `WebView` delegate, so it makes sense to also combine the internal message to match this. In addition, since `LoadStatus` is now exposed to the API if there is ever the need to add more statuses or to move to an event-based version, the API is already set up for this. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
b8ab820e3c
commit
fdfaf7b15c
11 changed files with 97 additions and 92 deletions
|
@ -24,14 +24,14 @@ use servo::servo_geometry::DeviceIndependentPixel;
|
|||
use servo::servo_url::ServoUrl;
|
||||
use servo::webrender_api::units::DevicePixel;
|
||||
use servo::webrender_traits::SurfmanRenderingContext;
|
||||
use servo::Servo;
|
||||
use servo::{LoadStatus, Servo};
|
||||
use winit::event::{ElementState, MouseButton, WindowEvent};
|
||||
use winit::event_loop::ActiveEventLoop;
|
||||
use winit::window::Window;
|
||||
|
||||
use super::egui_glue::EguiGlow;
|
||||
use super::geometry::winit_position_to_euclid_point;
|
||||
use super::webview::{LoadStatus, WebView, WebViewManager};
|
||||
use super::webview::{WebView, WebViewManager};
|
||||
|
||||
pub struct Minibrowser {
|
||||
pub context: EguiGlow,
|
||||
|
@ -108,7 +108,7 @@ impl Minibrowser {
|
|||
last_mouse_position: None,
|
||||
location: RefCell::new(initial_url.to_string()),
|
||||
location_dirty: false.into(),
|
||||
load_status: LoadStatus::LoadComplete,
|
||||
load_status: LoadStatus::Complete,
|
||||
status_text: None,
|
||||
}
|
||||
}
|
||||
|
@ -300,12 +300,12 @@ impl Minibrowser {
|
|||
}
|
||||
|
||||
match self.load_status {
|
||||
LoadStatus::LoadStart | LoadStatus::HeadParsed => {
|
||||
LoadStatus::Started | LoadStatus::HeadParsed => {
|
||||
if ui.add(Minibrowser::toolbar_button("X")).clicked() {
|
||||
warn!("Do not support stop yet.");
|
||||
}
|
||||
},
|
||||
LoadStatus::LoadComplete => {
|
||||
LoadStatus::Complete => {
|
||||
if ui.add(Minibrowser::toolbar_button("↻")).clicked() {
|
||||
event_queue.borrow_mut().push(MinibrowserEvent::Reload);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue