🐛 Remove transparent and use hideTitleBar

This commit is contained in:
Tw93
2024-05-09 20:50:11 +08:00
parent 4df5a667d7
commit 3473db7312
15 changed files with 59 additions and 45 deletions

View File

@@ -3,7 +3,7 @@
{
"url": "https://weread.qq.com",
"url_type": "web",
"transparent": true,
"hide_title_bar": true,
"fullscreen": false,
"width": 1200,
"height": 780,

View File

@@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
pub struct WindowConfig {
pub url: String,
pub transparent: bool,
pub hide_title_bar: bool,
pub fullscreen: bool,
pub width: f64,
pub height: f64,

View File

@@ -42,7 +42,7 @@ pub fn get_window(app: &mut App, config: PakeConfig, _data_dir: PathBuf) -> Wind
#[cfg(target_os = "macos")]
{
let title_bar_style = if window_config.transparent {
let title_bar_style = if window_config.hide_title_bar {
TitleBarStyle::Overlay
} else {
TitleBarStyle::Visible

View File

@@ -412,7 +412,7 @@ window.addEventListener('DOMContentLoaded', _event => {
}
`;
const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
if (window['pakeConfig']?.transparent && isMac) {
if (window['pakeConfig']?.hide_title_bar && isMac) {
const topPaddingStyleElement = document.createElement('style');
topPaddingStyleElement.innerHTML = topPaddingCSS;
document.head.appendChild(topPaddingStyleElement);