Merge branch 'upstream' into fix-hot-reloading

This commit is contained in:
Evan Almloff committed 2022-12-23 18:06:47 -06:00
commit 555b192436
6 files changed
+77 -99

No files matched your search

+8
View File
@@ -7,6 +7,7 @@ use serde_json::Value;
use std::future::Future;
use std::future::IntoFuture;
use std::pin::Pin;
use wry::application::dpi::LogicalSize;
use wry::application::event_loop::ControlFlow;
use wry::application::event_loop::EventLoopProxy;
#[cfg(target_os = "ios")]
@@ -136,6 +137,11 @@ impl DesktopContext {
let _ = self.proxy.send_event(SetZoomLevel(scale_factor));
}
/// modifies the inner size of the window
pub fn set_inner_size(&self, logical_size: LogicalSize<f64>) {
let _ = self.proxy.send_event(SetInnerSize(logical_size));
}
/// launch print modal
pub fn print(&self) {
let _ = self.proxy.send_event(Print);
@@ -188,6 +194,7 @@ pub enum UserWindowEvent {
SetDecorations(bool),
SetZoomLevel(f64),
SetInnerSize(LogicalSize<f64>),
Print,
DevTool,
@@ -259,6 +266,7 @@ impl DesktopController {
SetDecorations(state) => window.set_decorations(state),
SetZoomLevel(scale_factor) => webview.zoom(scale_factor),
SetInnerSize(logical_size) => window.set_inner_size(logical_size),
Print => {
if let Err(e) = webview.print() {