mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-26 17:31:06 +02:00
feat(window): refactor and improvements (#426)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
co-authored by
Lucas Nogueira
parent
5b3210c224
commit
84133b57b8
@@ -1,8 +1,10 @@
|
||||
<script>
|
||||
import { appWindow } from "@tauri-apps/plugin-window";
|
||||
import { getCurrent } from "@tauri-apps/plugin-window";
|
||||
import { invoke } from "@tauri-apps/api/tauri";
|
||||
import { onMount, onDestroy } from "svelte";
|
||||
|
||||
const appWindow = getCurrent();
|
||||
|
||||
export let onMessage;
|
||||
let unlisten;
|
||||
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
<script>
|
||||
import {
|
||||
appWindow,
|
||||
WebviewWindow,
|
||||
getCurrent,
|
||||
LogicalSize,
|
||||
UserAttentionType,
|
||||
PhysicalSize,
|
||||
PhysicalPosition,
|
||||
Effect,
|
||||
EffectState,
|
||||
Window
|
||||
} from "@tauri-apps/plugin-window";
|
||||
import { open as openDialog } from "@tauri-apps/plugin-dialog";
|
||||
import { open } from "@tauri-apps/plugin-shell";
|
||||
|
||||
const appWindow = getCurrent();
|
||||
|
||||
let selectedWindow = appWindow.label;
|
||||
const windowMap = {
|
||||
[appWindow.label]: appWindow,
|
||||
@@ -146,7 +148,7 @@
|
||||
function createWindow() {
|
||||
if (!newWindowLabel) return;
|
||||
|
||||
const webview = new WebviewWindow(newWindowLabel);
|
||||
const webview = new Window(newWindowLabel);
|
||||
windowMap[newWindowLabel] = webview;
|
||||
webview.once("tauri://error", function () {
|
||||
onMessage("Error creating new webview");
|
||||
|
||||
Reference in New Issue
Block a user