fix: fix code review comments
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
use tauri_utils::config::{Config, WindowConfig};
|
use tauri_utils::config::{Config, WindowConfig};
|
||||||
#[cfg(macos)]
|
#[cfg(target_os = "macos")]
|
||||||
use wry::{
|
use wry::{
|
||||||
application::{
|
application::{
|
||||||
platform::macos::WindowBuilderExtMacOS,
|
platform::macos::WindowBuilderExtMacOS,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(target_os = "windows")]
|
||||||
use wry::{
|
use wry::{
|
||||||
application::{
|
application::{
|
||||||
platform::windows::WindowBuilderExtWindows
|
platform::windows::WindowBuilderExtWindows
|
||||||
@@ -59,19 +59,20 @@ 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 common_window = WindowBuilder::new()
|
||||||
|
.with_resizable(resizable)
|
||||||
|
.with_transparent(transparent)
|
||||||
|
.with_fullscreen(if fullscreen {
|
||||||
|
Some(Fullscreen::Borderless(None))
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
})
|
||||||
|
.with_inner_size(wry::application::dpi::LogicalSize::new(width, height));
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
let init_window = || {
|
let init_window = || {
|
||||||
let window = WindowBuilder::new()
|
let window = common_window
|
||||||
.with_resizable(resizable)
|
|
||||||
.with_transparent(transparent)
|
|
||||||
.with_fullscreen(if fullscreen {
|
|
||||||
Some(Fullscreen::Borderless(None))
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
})
|
|
||||||
.with_decorations(false)
|
.with_decorations(false)
|
||||||
.with_title("")
|
.with_title("")
|
||||||
.with_inner_size(wry::application::dpi::LogicalSize::new(width, height))
|
|
||||||
.build(&event_loop)
|
.build(&event_loop)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
window
|
window
|
||||||
@@ -79,19 +80,11 @@ fn main() -> wry::Result<()> {
|
|||||||
|
|
||||||
#[cfg(macos)]
|
#[cfg(macos)]
|
||||||
let init_window = || {
|
let init_window = || {
|
||||||
let window = WindowBuilder::new()
|
let window = common_window
|
||||||
.with_resizable(resizable)
|
|
||||||
.with_titlebar_transparent(transparent)
|
|
||||||
.with_fullscreen(if fullscreen {
|
|
||||||
Some(Fullscreen::Borderless(None))
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
})
|
|
||||||
.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();
|
||||||
window
|
window
|
||||||
|
|||||||
Reference in New Issue
Block a user