Skip to content

Commit

Permalink
fix: enable shadows by default, closes #6909 (#6916)
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed May 9, 2023
1 parent 29ce9ce commit c417115
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changes/shadows-default-on.md
@@ -0,0 +1,5 @@
---
'tauri': 'patch'
---

Enable shadows by default.
2 changes: 1 addition & 1 deletion core/tauri-config-schema/schema.json
Expand Up @@ -702,7 +702,7 @@
},
"shadow": {
"description": "Whether or not the window has shadow.\n\n## Platform-specific\n\n- **Windows:** - `false` has no effect on decorated window, shadow are always ON. - `true` will make ndecorated window have a 1px white border, and on Windows 11, it will have a rounded corners. - **Linux:** Unsupported.",
"default": false,
"default": true,
"type": "boolean"
}
},
Expand Down
4 changes: 2 additions & 2 deletions core/tauri-utils/src/config.rs
Expand Up @@ -800,7 +800,7 @@ pub struct WindowConfig {
/// - `true` will make ndecorated window have a 1px white border,
/// and on Windows 11, it will have a rounded corners.
/// - **Linux:** Unsupported.
#[serde(default)]
#[serde(default = "default_true")]
pub shadow: bool,
}

Expand Down Expand Up @@ -837,7 +837,7 @@ impl Default for WindowConfig {
accept_first_mouse: false,
tabbing_identifier: None,
additional_browser_args: None,
shadow: false,
shadow: true,
}
}
}
Expand Down
5 changes: 1 addition & 4 deletions examples/api/src-tauri/src/lib.rs
Expand Up @@ -54,10 +54,7 @@ pub fn run() {

#[cfg(target_os = "windows")]
{
window_builder = window_builder
.transparent(true)
.shadow(true)
.decorations(false);
window_builder = window_builder.transparent(true).decorations(false);
}

let window = window_builder.build().unwrap();
Expand Down
1 change: 0 additions & 1 deletion examples/splashscreen/tauri.conf.json
Expand Up @@ -42,7 +42,6 @@
"width": 400,
"height": 200,
"decorations": false,
"shadow": true,
"resizable": false,
"url": "splashscreen.html"
}
Expand Down
2 changes: 1 addition & 1 deletion tooling/cli/schema.json
Expand Up @@ -702,7 +702,7 @@
},
"shadow": {
"description": "Whether or not the window has shadow.\n\n## Platform-specific\n\n- **Windows:** - `false` has no effect on decorated window, shadow are always ON. - `true` will make ndecorated window have a 1px white border, and on Windows 11, it will have a rounded corners. - **Linux:** Unsupported.",
"default": false,
"default": true,
"type": "boolean"
}
},
Expand Down

0 comments on commit c417115

Please sign in to comment.