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" ) ; タウリを使用している場合は、忘れないでください。
html, body { background: transparent } index.html#l12を参照してください"windows": [ { "transparent": true } ] tauri.conf.json#l57を参照"macOSPrivateApi": trueを参照してくださいtauri.conf.json#l49タウリでの使用のより完全な例については、 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以降 |
| Apply_blur | Apply_acrylic | Apply_mica | Apply_Vibrancy |
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |