Browse Source

fix: enable shadows by default, closes #6909 (#6916)

Amr Bashir 2 năm trước cách đây
mục cha
commit
c4171152c1

+ 5 - 0
.changes/shadows-default-on.md

@@ -0,0 +1,5 @@
+---
+'tauri': 'patch'
+---
+
+Enable shadows by default.

+ 1 - 1
core/tauri-config-schema/schema.json

@@ -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"
         }
       },

+ 2 - 2
core/tauri-utils/src/config.rs

@@ -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,
 }
 
@@ -837,7 +837,7 @@ impl Default for WindowConfig {
       accept_first_mouse: false,
       tabbing_identifier: None,
       additional_browser_args: None,
-      shadow: false,
+      shadow: true,
     }
   }
 }

+ 1 - 4
examples/api/src-tauri/src/lib.rs

@@ -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();

+ 0 - 1
examples/splashscreen/tauri.conf.json

@@ -42,7 +42,6 @@
         "width": 400,
         "height": 200,
         "decorations": false,
-        "shadow": true,
         "resizable": false,
         "url": "splashscreen.html"
       }

+ 1 - 1
tooling/cli/schema.json

@@ -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"
         }
       },