mirror of
https://github.com/safing/portmaster
synced 2025-04-25 13:29:10 +00:00
[desktop] tauri fix main windows size and theme
This commit is contained in:
parent
674787df87
commit
5b03076fac
2 changed files with 8 additions and 3 deletions
desktop/tauri/src-tauri
|
@ -21,12 +21,15 @@
|
|||
"window:allow-show",
|
||||
"window:allow-is-visible",
|
||||
"window:allow-set-focus",
|
||||
"window:allow-close",
|
||||
"app:default",
|
||||
"image:default",
|
||||
"resources:default",
|
||||
"menu:default",
|
||||
"tray:default",
|
||||
"shell:allow-open",
|
||||
"notification:default"
|
||||
"notification:default",
|
||||
"window-state:allow-save-window-state",
|
||||
"window-state:allow-restore-state"
|
||||
]
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
use log::{debug, error};
|
||||
use tauri::{
|
||||
AppHandle, Manager, Result, UserAttentionType, WebviewUrl, WebviewWindow, WebviewWindowBuilder,
|
||||
AppHandle, Listener, Manager, Result, Theme, UserAttentionType, WebviewUrl, WebviewWindow,
|
||||
WebviewWindowBuilder,
|
||||
};
|
||||
|
||||
use crate::portmaster::PortmasterExt;
|
||||
|
@ -16,7 +17,6 @@ use crate::portmaster::PortmasterExt;
|
|||
pub fn create_main_window(app: &AppHandle) -> Result<WebviewWindow> {
|
||||
let mut window = if let Some(window) = app.get_webview_window("main") {
|
||||
debug!("[tauri] main window already created");
|
||||
|
||||
window
|
||||
} else {
|
||||
debug!("[tauri] creating main window");
|
||||
|
@ -24,6 +24,8 @@ pub fn create_main_window(app: &AppHandle) -> Result<WebviewWindow> {
|
|||
let res = WebviewWindowBuilder::new(app, "main", WebviewUrl::App("index.html".into()))
|
||||
.title("Portmaster")
|
||||
.visible(false)
|
||||
.inner_size(1200.0, 700.0)
|
||||
.theme(Some(Theme::Dark))
|
||||
.build();
|
||||
|
||||
match res {
|
||||
|
|
Loading…
Add table
Reference in a new issue