mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
feat(positioner, window-state): impl WindowExt for WebviewWindow (#1283)
closes #1281
This commit is contained in:
@@ -8,7 +8,7 @@ use crate::Tray;
|
||||
use serde_repr::Deserialize_repr;
|
||||
#[cfg(feature = "tray-icon")]
|
||||
use tauri::Manager;
|
||||
use tauri::{PhysicalPosition, PhysicalSize, Result, Runtime, Window};
|
||||
use tauri::{PhysicalPosition, PhysicalSize, Result, Runtime, WebviewWindow, Window};
|
||||
|
||||
/// Well known window positions.
|
||||
#[derive(Debug, Deserialize_repr)]
|
||||
@@ -45,6 +45,11 @@ pub trait WindowExt {
|
||||
fn move_window(&self, position: Position) -> Result<()>;
|
||||
}
|
||||
|
||||
impl<R: Runtime> WindowExt for WebviewWindow<R> {
|
||||
fn move_window(&self, pos: Position) -> Result<()> {
|
||||
self.as_ref().window().move_window(pos)
|
||||
}
|
||||
}
|
||||
impl<R: Runtime> WindowExt for Window<R> {
|
||||
fn move_window(&self, pos: Position) -> Result<()> {
|
||||
use Position::*;
|
||||
|
||||
Reference in New Issue
Block a user