window vibrancy
vibrancy v0.5.2
Machen Sie Ihre Fenster lebendig.
Tipp
Wenn Sie tauri@v1 verwenden, müssen Sie Version 0.4 dieser Kiste verwenden.
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" ) ; Wenn Sie Tauri verwenden, vergessen Sie nicht:
html, body { background: transparent } Siehe Index.html#L12"windows": [ { "transparent": true } ] siehe tauri.conf.json#l57"macOSPrivateApi": true siehe tauri.conf.json#l49 Ein umfassenderes Beispiel für die Verwendung mit Tauri finden Sie examples/tauri .
| Funktion | Unterstützte Plattformen | Notizen |
|---|---|---|
apply_blur & clear_blur | Windows 7/10/11 (nur 22H1) | Schlechte Leistung beim Größe/Ziehen des Fensters unter Windows 11 Build 22621+. |
apply_acrylic & clear_acrylic | Windows 10/11 | Schlechte Leistung beim Größe/Ziehen des Fensters unter Windows 10 V1903+ und Windows 11 Build 22000. |
apply_mica & clear_mica | Windows 11 | |
apply_vibrancy | macOS 10.10 und neuer |
| apply_blur | apply_acrylic | apply_mica | apply_vibrancy |
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |