webview: Public the raw wry webview handle (#1739)

This commit is contained in:
Floyd Wang 2025-12-04 11:53:28 +08:00 committed by GitHub
parent 514aea00be
commit 13eceab1ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,14 +1,14 @@
use std::{ops::Deref, rc::Rc};
use wry::{
dpi::{self, LogicalSize},
Rect,
dpi::{self, LogicalSize},
};
use gpui::{
canvas, div, App, Bounds, ContentMask, DismissEvent, Element, ElementId, Entity, EventEmitter,
FocusHandle, Focusable, GlobalElementId, Hitbox, InteractiveElement, IntoElement, LayoutId,
MouseDownEvent, ParentElement as _, Pixels, Render, Size, Style, Styled as _, Window,
App, Bounds, ContentMask, DismissEvent, Element, ElementId, Entity, EventEmitter, FocusHandle,
Focusable, GlobalElementId, Hitbox, InteractiveElement, IntoElement, LayoutId, MouseDownEvent,
ParentElement as _, Pixels, Render, Size, Style, Styled as _, Window, canvas, div,
};
use crate::PixelsExt;
@ -74,6 +74,11 @@ impl WebView {
pub fn load_url(&mut self, url: &str) {
self.webview.load_url(url).unwrap();
}
/// Get the raw wry webview.
pub fn raw(&self) -> &wry::WebView {
&self.webview
}
}
impl Deref for WebView {