Merge pull request #60 from m1911star/master
feat: make pake run on windows
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
"dev": "npm run tauri dev",
|
"dev": "npm run tauri dev",
|
||||||
"dev:debug": "npm run tauri dev -- --features devtools",
|
"dev:debug": "npm run tauri dev -- --features devtools",
|
||||||
"build": "npm run tauri build -- --target universal-apple-darwin",
|
"build": "npm run tauri build -- --target universal-apple-darwin",
|
||||||
|
"build:windows": "npm run tauri build -- --target x86_64-pc-windows-msvc",
|
||||||
"tauri": "tauri"
|
"tauri": "tauri"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
BIN
src-tauri/icons/icon.ico
Normal file
BIN
src-tauri/icons/icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
@@ -1,4 +1,8 @@
|
|||||||
use tauri_utils::config::{Config, WindowConfig};
|
use tauri_utils::config::{Config, WindowConfig};
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
use wry::application::platform::macos::WindowBuilderExtMacOS;
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
use wry::application::platform::windows::WindowBuilderExtWindows;
|
||||||
|
|
||||||
fn main() -> wry::Result<()> {
|
fn main() -> wry::Result<()> {
|
||||||
use wry::{
|
use wry::{
|
||||||
@@ -8,7 +12,6 @@ fn main() -> wry::Result<()> {
|
|||||||
event_loop::{ControlFlow, EventLoop},
|
event_loop::{ControlFlow, EventLoop},
|
||||||
keyboard::KeyCode,
|
keyboard::KeyCode,
|
||||||
menu::{MenuBar as Menu, MenuItem, MenuItemAttributes, MenuType},
|
menu::{MenuBar as Menu, MenuItem, MenuItemAttributes, MenuType},
|
||||||
platform::macos::WindowBuilderExtMacOS,
|
|
||||||
window::{Fullscreen, Window, WindowBuilder},
|
window::{Fullscreen, Window, WindowBuilder},
|
||||||
},
|
},
|
||||||
webview::WebViewBuilder,
|
webview::WebViewBuilder,
|
||||||
@@ -46,19 +49,29 @@ fn main() -> wry::Result<()> {
|
|||||||
..
|
..
|
||||||
} = get_windows_config().unwrap_or(WindowConfig::default());
|
} = get_windows_config().unwrap_or(WindowConfig::default());
|
||||||
let event_loop = EventLoop::new();
|
let event_loop = EventLoop::new();
|
||||||
let window = WindowBuilder::new()
|
|
||||||
|
let common_window = WindowBuilder::new()
|
||||||
.with_resizable(resizable)
|
.with_resizable(resizable)
|
||||||
.with_titlebar_transparent(transparent)
|
.with_transparent(transparent)
|
||||||
.with_fullscreen(if fullscreen {
|
.with_fullscreen(if fullscreen {
|
||||||
Some(Fullscreen::Borderless(None))
|
Some(Fullscreen::Borderless(None))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
})
|
})
|
||||||
|
.with_inner_size(wry::application::dpi::LogicalSize::new(width, height));
|
||||||
|
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
let window = common_window
|
||||||
|
.with_decorations(false)
|
||||||
|
.with_title("")
|
||||||
|
.build(&event_loop)
|
||||||
|
.unwrap();
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
let window = common_window
|
||||||
.with_fullsize_content_view(true)
|
.with_fullsize_content_view(true)
|
||||||
.with_titlebar_buttons_hidden(false)
|
.with_titlebar_buttons_hidden(false)
|
||||||
.with_title_hidden(true)
|
.with_title_hidden(true)
|
||||||
.with_menu(menu_bar_menu)
|
.with_menu(menu_bar_menu)
|
||||||
.with_inner_size(wry::application::dpi::LogicalSize::new(width, height))
|
|
||||||
.build(&event_loop)
|
.build(&event_loop)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,10 @@
|
|||||||
"all": true
|
"all": true
|
||||||
},
|
},
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"icon": ["icons/weRead.icns"],
|
"icon": [
|
||||||
|
"icons/weRead.icns",
|
||||||
|
"icons/icon.ico"
|
||||||
|
],
|
||||||
"active": true,
|
"active": true,
|
||||||
"category": "DeveloperTool",
|
"category": "DeveloperTool",
|
||||||
"copyright": "",
|
"copyright": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user