Use frontend for making windows instead

This commit is contained in:
Lncvrt committed 2026-05-07 12:57:07 -07:00
1 parent 43d286b4e5
commit 302a449fd7
3 files changed
+10 -33

No files matched your search

+1
View File
@@ -18,6 +18,7 @@
"core:window:allow-start-dragging", "core:window:allow-start-dragging",
"core:window:allow-toggle-maximize", "core:window:allow-toggle-maximize",
"core:window:allow-request-user-attention", "core:window:allow-request-user-attention",
"core:webview:allow-create-webview-window",
"fs:default", "fs:default",
"dialog:default", "dialog:default",
"dialog:allow-open", "dialog:allow-open",
-26
View File
@@ -678,31 +678,6 @@ fn remove_stale_executable(app: AppHandle, version: String, executable: String)
} }
} }
#[tauri::command]
fn open_new_window(
app: tauri::AppHandle,
title: String,
name: String,
url: String,
width: f64,
height: f64,
) {
if let Some(window) = app.get_webview_window(&name) {
let _ = window.show();
return;
};
tauri::WebviewWindowBuilder::new(
&app,
name,
tauri::WebviewUrl::External(url.parse().unwrap()),
)
.inner_size(width, height)
.title(title)
.build()
.unwrap();
}
#[cfg_attr(mobile, tauri::mobile_entry_point)] #[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() { pub fn run() {
#[allow(unused)] #[allow(unused)]
@@ -731,7 +706,6 @@ pub fn run() {
folder_size, folder_size,
verify_signature, verify_signature,
cancel_download, cancel_download,
open_new_window,
move_game_data, move_game_data,
restart_app, restart_app,
open_game_folder, open_game_folder,
+9 -7
View File
@@ -2,7 +2,6 @@
import '../Installs.css' import '../Installs.css'
import { useEffect } from 'react' import { useEffect } from 'react'
import { invoke } from '@tauri-apps/api/core'
import { useGlobal } from '@/providers/GlobalProvider' import { useGlobal } from '@/providers/GlobalProvider'
import { useSearchParams } from 'next/navigation' import { useSearchParams } from 'next/navigation'
import { platform } from '@tauri-apps/plugin-os' import { platform } from '@tauri-apps/plugin-os'
@@ -10,6 +9,7 @@ import { faWarning } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { ask } from '@tauri-apps/plugin-dialog' import { ask } from '@tauri-apps/plugin-dialog'
import { BaseDirectory, exists } from '@tauri-apps/plugin-fs' import { BaseDirectory, exists } from '@tauri-apps/plugin-fs'
import { WebviewWindow } from '@tauri-apps/api/webviewWindow'
export default function Installs () { export default function Installs () {
const { const {
@@ -74,14 +74,15 @@ export default function Installs () {
<button <button
className='button btntheme1' className='button btntheme1'
onClick={() => onClick={() =>
invoke('open_new_window', { new WebviewWindow('berrydashleaderboards', {
title: 'Berry Dash Leaderboards', title: 'Berry Dash Leaderboards',
name: 'berrydashleaderboards',
url: url:
'https://games.lncvrt.xyz/game/berry-dash/leaderboards?launcher=1&theme=' + 'https://games.lncvrt.xyz/game/berry-dash/leaderboards?launcher=1&theme=' +
theme, theme,
width: 800, width: 800,
height: 600 height: 600,
resizable: false,
maximizable: false
}) })
} }
title='View the leaderboards for this game.' title='View the leaderboards for this game.'
@@ -92,12 +93,13 @@ export default function Installs () {
<button <button
className='button btntheme1' className='button btntheme1'
onClick={() => onClick={() =>
invoke('open_new_window', { new WebviewWindow('xpsdashboard', {
title: 'XPS Dashboard', title: 'XPS Dashboard',
name: 'xpsdashboard',
url: 'https://xps.lncvrt.xyz/dashboard/', url: 'https://xps.lncvrt.xyz/dashboard/',
width: 1280, width: 1280,
height: 720 height: 720,
minWidth: 1280,
minHeight: 720
}) })
} }
title='Open the GDPS Dashboard!' title='Open the GDPS Dashboard!'