window vibrancy
vibrancy v0.5.2
ทำให้หน้าต่างของคุณมีชีวิตชีวา
เคล็ดลับ
หากคุณใช้ tauri@v1 คุณต้องใช้เวอร์ชัน 0.4 ของลังนี้
use window_vibrancy :: { apply_blur , apply_vibrancy , NSVisualEffectMaterial } ;
# [ cfg ( target_os = "macos" ) ]
apply_vibrancy ( & window , NSVisualEffectMaterial :: HudWindow , None , None ) . expect ( "Unsupported platform! 'apply_vibrancy' is only supported on macOS" ) ;
# [ cfg ( target_os = "windows" ) ]
apply_blur ( & window , Some ( ( 18 , 18 , 18 , 125 ) ) ) . expect ( "Unsupported platform! 'apply_blur' is only supported on Windows" ) ; หากคุณใช้ Tauri อย่าลืม:
html, body { background: transparent } ดู index.html#l12"windows": [ { "transparent": true } ] ดู tauri.conf.json#l57"macOSPrivateApi": true ดู tauri.conf.json#l49 สำหรับตัวอย่างที่สมบูรณ์ยิ่งขึ้นของการใช้งานกับ tauri ดู examples/tauri
| การทำงาน | แพลตฟอร์มที่รองรับ | หมายเหตุ |
|---|---|---|
apply_blur & clear_blur | Windows 7/10/11 (22h1 เท่านั้น) | ประสิทธิภาพที่ไม่ดีเมื่อปรับขนาด/ลากหน้าต่างบน Windows 11 Build 22621+ |
apply_acrylic & clear_acrylic | Windows 10/11 | ประสิทธิภาพที่ไม่ดีเมื่อปรับขนาด/ลากหน้าต่างบน Windows 10 V1903+ และ Windows 11 สร้าง 22000 |
apply_mica & clear_mica | Windows 11 | |
apply_vibrancy | MacOS 10.10 และใหม่กว่า |
| appl_blur | appl_acrylic | appl_mica | appl_vibrancy |
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |