window vibrancy
vibrancy v0.5.2
Rendre vos fenêtres vibrantes.
Conseil
Si vous utilisez tauri@v1 , vous devez utiliser la version 0.4 de cette caisse.
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" ) ; Si vous utilisez Tauri, n'oubliez pas:
html, body { background: transparent } Voir index.html # l12"windows": [ { "transparent": true } ] voir tauri.conf.json # l57"macOSPrivateApi": true voir tauri.conf.json # l49 Pour un exemple plus complet d'utilisation avec Tauri, voir examples/tauri .
| Fonction | Plates-formes prises en charge | Notes |
|---|---|---|
apply_blur & clear_blur | Windows 7/10/11 (22h1 seulement) | Mauvaises performances lors de la redimensionnement / traînant la fenêtre sur Windows 11 Build 22621+. |
apply_acrylic & clear_acrylic | Windows 10/11 | Mauvaises performances lors de la redimensionnement / traînant la fenêtre sur Windows 10 V1903 + et Windows 11 Build 22000. |
apply_mica & clear_mica | Windows 11 | |
apply_vibrancy | macOS 10.10 et plus récent |
| appliquer_blur | appliquer_acrylic | appliquer_mica | appliquer_vibrance |
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |