fix hooks release build

This commit is contained in:
Evan Almloff committed 2024-06-10 07:41:15 -05:00
1 parent 689ac5433f
commit 79e18c2d62
3 files changed
+6 -10

No files matched your search

+4 -2
View File
@@ -18,7 +18,7 @@ use std::{
sync::Arc, sync::Arc,
}; };
use tao::{ use tao::{
dpi::{PhysicalPosition, PhysicalSize}, dpi::PhysicalSize,
event::Event, event::Event,
event_loop::{ControlFlow, EventLoop, EventLoopBuilder, EventLoopProxy, EventLoopWindowTarget}, event_loop::{ControlFlow, EventLoop, EventLoopBuilder, EventLoopProxy, EventLoopWindowTarget},
window::WindowId, window::WindowId,
@@ -478,7 +478,9 @@ impl App {
let window = &webview.desktop_context.window; let window = &webview.desktop_context.window;
let position = (state.x, state.y); let position = (state.x, state.y);
let size = (state.width, state.height); let size = (state.width, state.height);
window.set_outer_position(PhysicalPosition::new(position.0, position.1)); window.set_outer_position(tao::dpi::PhysicalPosition::new(
position.0, position.1,
));
window.set_inner_size(PhysicalSize::new(size.0, size.1)); window.set_inner_size(PhysicalSize::new(size.0, size.1));
} }
} }
+1 -8
View File
@@ -84,7 +84,6 @@ pub fn use_signal_sync<T: Send + Sync + 'static>(f: impl FnOnce() -> T) -> Signa
fn use_maybe_signal_sync<T: 'static, U: Storage<SignalData<T>>>( fn use_maybe_signal_sync<T: 'static, U: Storage<SignalData<T>>>(
f: impl FnOnce() -> T, f: impl FnOnce() -> T,
) -> Signal<T, U> { ) -> Signal<T, U> {
#[cfg(debug_assertions)]
let caller = std::panic::Location::caller(); let caller = std::panic::Location::caller();
// todo: (jon) // todo: (jon)
@@ -92,11 +91,5 @@ fn use_maybe_signal_sync<T: 'static, U: Storage<SignalData<T>>>(
// any calls to .read() in the body will re-subscribe the component to the signal // any calls to .read() in the body will re-subscribe the component to the signal
// use_before_render(move || signal.unsubscribe(current_scope_id().unwrap())); // use_before_render(move || signal.unsubscribe(current_scope_id().unwrap()));
use_hook(|| { use_hook(|| Signal::new_with_caller(f(), caller))
Signal::new_with_caller(
f(),
#[cfg(debug_assertions)]
caller,
)
})
} }
+1
View File
@@ -165,6 +165,7 @@ impl<T: 'static, S: Storage<SignalData<T>>> Signal<T, S> {
/// use_hook(move || Signal::new_with_caller(function(), caller)) /// use_hook(move || Signal::new_with_caller(function(), caller))
/// } /// }
/// ``` /// ```
#[allow(unused)]
pub fn new_with_caller(value: T, caller: &'static std::panic::Location<'static>) -> Self { pub fn new_with_caller(value: T, caller: &'static std::panic::Location<'static>) -> Self {
Self { Self {
inner: CopyValue::new_with_caller( inner: CopyValue::new_with_caller(