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 Build 22000. |
apply_mica & clear_mica | Windows 11 | |
apply_vibrancy | ماكوس 10.10 وأحدث |
| تطبيق _blur | application_acrylic | تطبيق _mica | تطبيق _vibrancy |
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |