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 authored 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tauri': 'patch'
---

Enable shadows by default.
2 changes: 1 addition & 1 deletion core/tauri-config-schema/schema.json
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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.