From 5b4beca9b4ad5fc25955f90918edefe811290115 Mon Sep 17 00:00:00 2001 From: LiJianying Date: Tue, 1 Dec 2026 16:57:13 +0800 Subject: [PATCH] Sync with core 61bbd83 --- .../src/CNativeAPI/generated/WindowTaskbar.cs | 11 ++ .../csharp/src/NativeAPI/WindowTaskbar.cs | 21 +++ .../lib/src/bindings_generated.dart | 13 ++ .../nativeapi/lib/src/web/window_taskbar.dart | 6 + .../nativeapi/lib/src/window_taskbar.dart | 17 ++ bindings/go/nativeapi.gen.go | 27 ++++ bindings/js/lib/window_taskbar.ts | 12 ++ bindings/js/src/generated/window_taskbar.cc | 52 ++++++ bindings/python/nativeapi/_capi.py | 22 +++ bindings/python/nativeapi/window_taskbar.py | 16 ++ bindings/rust/cnativeapi/src/bindings.rs | 15 ++ bindings/rust/nativeapi/src/window_taskbar.rs | 18 +++ .../Sources/NativeAPI/WindowTaskbar.swift | 14 ++ core | 2 +- specs/window-taskbar.md | 9 +- website/content/api/window_taskbar.json | 152 ++++++++++++++++++ 16 files changed, 405 insertions(+), 2 deletions(-) diff --git a/bindings/csharp/src/CNativeAPI/generated/WindowTaskbar.cs b/bindings/csharp/src/CNativeAPI/generated/WindowTaskbar.cs index 01b2819..0ddb7d1 100644 --- a/bindings/csharp/src/CNativeAPI/generated/WindowTaskbar.cs +++ b/bindings/csharp/src/CNativeAPI/generated/WindowTaskbar.cs @@ -100,6 +100,10 @@ public static partial class Interop [return: MarshalAs(UnmanagedType.I1)] public static extern bool native_window_taskbar_remove_thumbnail_button_by_id(ulong self, uint buttonId); + [DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool native_window_taskbar_reset_thumbnail(ulong self); + [DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool native_window_taskbar_set_overlay_icon(ulong self, ulong icon, [MarshalAs(UnmanagedType.LPUTF8Str)] string? description); @@ -112,6 +116,10 @@ public static partial class Interop [return: MarshalAs(UnmanagedType.I1)] public static extern bool native_window_taskbar_set_progress_value(ulong self, double progress); + [DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool native_window_taskbar_set_thumbnail(ulong self, ulong thumbnail); + [DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool native_window_taskbar_start_flashing(ulong self, native_taskbar_flash_options_t options); @@ -159,6 +167,9 @@ public static partial class Interop [DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)] public static extern ulong native_window_taskbar_get_overlay_icon(ulong self); + [DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong native_window_taskbar_get_thumbnail(ulong self); + [DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)] public static extern ulong native_window_taskbar_get_thumbnail_button_at(ulong self, CULong index); diff --git a/bindings/csharp/src/NativeAPI/WindowTaskbar.cs b/bindings/csharp/src/NativeAPI/WindowTaskbar.cs index f685930..be847c6 100644 --- a/bindings/csharp/src/NativeAPI/WindowTaskbar.cs +++ b/bindings/csharp/src/NativeAPI/WindowTaskbar.cs @@ -341,6 +341,27 @@ public string? OverlayIconDescription } } + public bool SetThumbnail(Image? thumbnail) + { + var rawResult = Interop.native_window_taskbar_set_thumbnail(NativeHandle, thumbnail?.NativeHandle ?? 0); + return rawResult; + } + + public Image? Thumbnail + { + get + { + var rawResult = Interop.native_window_taskbar_get_thumbnail(NativeHandle); + return rawResult == 0 ? null : new Image(rawResult); + } + } + + public bool ResetThumbnail() + { + var rawResult = Interop.native_window_taskbar_reset_thumbnail(NativeHandle); + return rawResult; + } + public bool AddThumbnailButton(TaskbarThumbnailButton? button) { var rawResult = Interop.native_window_taskbar_add_thumbnail_button(NativeHandle, button?.NativeHandle ?? 0); diff --git a/bindings/dart/cnativeapi/lib/src/bindings_generated.dart b/bindings/dart/cnativeapi/lib/src/bindings_generated.dart index 40e18aa..758d18d 100644 --- a/bindings/dart/cnativeapi/lib/src/bindings_generated.dart +++ b/bindings/dart/cnativeapi/lib/src/bindings_generated.dart @@ -4066,6 +4066,10 @@ native_taskbar_progress_state_t native_window_taskbar_get_progress_state( @ffi.Native() external double native_window_taskbar_get_progress_value(int window_taskbar); +/// Caller owns the returned handle; release it with native_image_free(). +@ffi.Native() +external int native_window_taskbar_get_thumbnail(int window_taskbar); + /// Caller owns the returned handle; release it with native_taskbar_thumbnail_button_free(). @ffi.Native< native_taskbar_thumbnail_button_t Function( @@ -4143,6 +4147,9 @@ external bool native_window_taskbar_remove_thumbnail_button_by_id( int button_id, ); +@ffi.Native() +external bool native_window_taskbar_reset_thumbnail(int window_taskbar); + @ffi.Native< ffi.Bool Function( native_window_taskbar_t, @@ -4177,6 +4184,12 @@ external bool native_window_taskbar_set_progress_value( double progress, ); +@ffi.Native() +external bool native_window_taskbar_set_thumbnail( + int window_taskbar, + int thumbnail, +); + @ffi.Native< ffi.Bool Function(native_window_taskbar_t, native_taskbar_flash_options_t) >() diff --git a/bindings/dart/nativeapi/lib/src/web/window_taskbar.dart b/bindings/dart/nativeapi/lib/src/web/window_taskbar.dart index 837950e..5fa6138 100644 --- a/bindings/dart/nativeapi/lib/src/web/window_taskbar.dart +++ b/bindings/dart/nativeapi/lib/src/web/window_taskbar.dart @@ -161,6 +161,12 @@ class WindowTaskbar { String? get overlayIconDescription => unsupported(); + bool setThumbnail(Image? thumbnail) => unsupported(); + + Image? get thumbnail => unsupported(); + + bool resetThumbnail() => unsupported(); + bool addThumbnailButton(TaskbarThumbnailButton? button) => unsupported(); bool insertThumbnailButton(int index, TaskbarThumbnailButton? button) => diff --git a/bindings/dart/nativeapi/lib/src/window_taskbar.dart b/bindings/dart/nativeapi/lib/src/window_taskbar.dart index 37d37f1..a172ac3 100644 --- a/bindings/dart/nativeapi/lib/src/window_taskbar.dart +++ b/bindings/dart/nativeapi/lib/src/window_taskbar.dart @@ -381,6 +381,23 @@ class WindowTaskbar implements ffi.Finalizable { return result; } + bool setThumbnail(Image? thumbnail) { + return c.native_window_taskbar_set_thumbnail( + nativeHandle, + thumbnail?.nativeHandle ?? 0, + ); + } + + Image? get thumbnail { + final handle = c.native_window_taskbar_get_thumbnail(nativeHandle); + if (handle == 0) return null; + return Image.fromHandle(handle); + } + + bool resetThumbnail() { + return c.native_window_taskbar_reset_thumbnail(nativeHandle); + } + bool addThumbnailButton(TaskbarThumbnailButton? button) { return c.native_window_taskbar_add_thumbnail_button( nativeHandle, diff --git a/bindings/go/nativeapi.gen.go b/bindings/go/nativeapi.gen.go index 27ba806..b3bbf39 100644 --- a/bindings/go/nativeapi.gen.go +++ b/bindings/go/nativeapi.gen.go @@ -3732,6 +3732,33 @@ func (wt *WindowTaskbar) OverlayIconDescription() string { return C.GoString(result) } +// SetThumbnail invokes the native SetThumbnail operation. +// Failure wraps ErrOperationFailed; the native ABI provides no detailed cause. +func (wt *WindowTaskbar) SetThumbnail(thumbnail *Image) error { + result := C.native_window_taskbar_set_thumbnail(C.native_window_taskbar_t(wt.nativeHandleValue()), C.native_image_t(thumbnail.nativeHandleValue())) + if !bool(result) { + return nativeError("WindowTaskbar.SetThumbnail") + } + return nil +} + +// Thumbnail invokes the native GetThumbnail operation. +// The returned reference is owned; nil means no object is available. +func (wt *WindowTaskbar) Thumbnail() *Image { + result := C.native_window_taskbar_get_thumbnail(C.native_window_taskbar_t(wt.nativeHandleValue())) + return wrapImage(uint64(result), false) +} + +// ResetThumbnail invokes the native ResetThumbnail operation. +// Failure wraps ErrOperationFailed; the native ABI provides no detailed cause. +func (wt *WindowTaskbar) ResetThumbnail() error { + result := C.native_window_taskbar_reset_thumbnail(C.native_window_taskbar_t(wt.nativeHandleValue())) + if !bool(result) { + return nativeError("WindowTaskbar.ResetThumbnail") + } + return nil +} + // AddThumbnailButton invokes the native AddThumbnailButton operation. // Failure wraps ErrOperationFailed; the native ABI provides no detailed cause. func (wt *WindowTaskbar) AddThumbnailButton(button *TaskbarThumbnailButton) error { diff --git a/bindings/js/lib/window_taskbar.ts b/bindings/js/lib/window_taskbar.ts index a151990..e9215aa 100644 --- a/bindings/js/lib/window_taskbar.ts +++ b/bindings/js/lib/window_taskbar.ts @@ -161,6 +161,18 @@ export class WindowTaskbar extends NativeObject { return native.native_window_taskbar_get_overlay_icon_description(this.nativeHandle); } + setThumbnail(thumbnail: Image | null): boolean { + return native.native_window_taskbar_set_thumbnail(this.nativeHandle, thumbnail?.nativeHandle ?? 0n); + } + + get thumbnail(): Image | null { + return wrapHandle(Image, native.native_window_taskbar_get_thumbnail(this.nativeHandle)); + } + + resetThumbnail(): boolean { + return native.native_window_taskbar_reset_thumbnail(this.nativeHandle); + } + addThumbnailButton(button: TaskbarThumbnailButton | null): boolean { return native.native_window_taskbar_add_thumbnail_button(this.nativeHandle, button?.nativeHandle ?? 0n); } diff --git a/bindings/js/src/generated/window_taskbar.cc b/bindings/js/src/generated/window_taskbar.cc index eab598e..390b715 100644 --- a/bindings/js/src/generated/window_taskbar.cc +++ b/bindings/js/src/generated/window_taskbar.cc @@ -494,6 +494,55 @@ napi_value Js_native_window_taskbar_get_overlay_icon_description(napi_env env, n return value.ToJs(env); } +napi_value Js_native_window_taskbar_set_thumbnail(napi_env env, napi_callback_info info) { + Args args(env, info); + if (!args.ok()) { + return nullptr; + } + Arena arena; + (void)arena; + uint64_t self = 0; + if (!GetHandle(env, args[0], &self)) { + return nullptr; + } + native_image_t p0 = {}; + if (!GetHandle(env, args[1], &p0)) { + return nullptr; + } + auto result = OnMainThread([&] { return native_window_taskbar_set_thumbnail(self, p0); }); + return Value::Bool(result).ToJs(env); +} + +napi_value Js_native_window_taskbar_get_thumbnail(napi_env env, napi_callback_info info) { + Args args(env, info); + if (!args.ok()) { + return nullptr; + } + Arena arena; + (void)arena; + uint64_t self = 0; + if (!GetHandle(env, args[0], &self)) { + return nullptr; + } + auto result = OnMainThread([&] { return native_window_taskbar_get_thumbnail(self); }); + return Value::BigInt(result).ToJs(env); +} + +napi_value Js_native_window_taskbar_reset_thumbnail(napi_env env, napi_callback_info info) { + Args args(env, info); + if (!args.ok()) { + return nullptr; + } + Arena arena; + (void)arena; + uint64_t self = 0; + if (!GetHandle(env, args[0], &self)) { + return nullptr; + } + auto result = OnMainThread([&] { return native_window_taskbar_reset_thumbnail(self); }); + return Value::Bool(result).ToJs(env); +} + napi_value Js_native_window_taskbar_add_thumbnail_button(napi_env env, napi_callback_info info) { Args args(env, info); if (!args.ok()) { @@ -787,6 +836,9 @@ void RegisterWindowTaskbar(napi_env env, napi_value exports) { Export(env, exports, "native_window_taskbar_set_overlay_icon", Js_native_window_taskbar_set_overlay_icon); Export(env, exports, "native_window_taskbar_get_overlay_icon", Js_native_window_taskbar_get_overlay_icon); Export(env, exports, "native_window_taskbar_get_overlay_icon_description", Js_native_window_taskbar_get_overlay_icon_description); + Export(env, exports, "native_window_taskbar_set_thumbnail", Js_native_window_taskbar_set_thumbnail); + Export(env, exports, "native_window_taskbar_get_thumbnail", Js_native_window_taskbar_get_thumbnail); + Export(env, exports, "native_window_taskbar_reset_thumbnail", Js_native_window_taskbar_reset_thumbnail); Export(env, exports, "native_window_taskbar_add_thumbnail_button", Js_native_window_taskbar_add_thumbnail_button); Export(env, exports, "native_window_taskbar_insert_thumbnail_button", Js_native_window_taskbar_insert_thumbnail_button); Export(env, exports, "native_window_taskbar_remove_thumbnail_button", Js_native_window_taskbar_remove_thumbnail_button); diff --git a/bindings/python/nativeapi/_capi.py b/bindings/python/nativeapi/_capi.py index 74c5c04..e4abf51 100644 --- a/bindings/python/nativeapi/_capi.py +++ b/bindings/python/nativeapi/_capi.py @@ -2742,6 +2742,28 @@ class native_window_list_t(Structure): c_uint64, ], ) +native_window_taskbar_set_thumbnail = function( + "native_window_taskbar_set_thumbnail", + c_bool, + [ + c_uint64, + c_uint64, + ], +) +native_window_taskbar_get_thumbnail = function( + "native_window_taskbar_get_thumbnail", + c_uint64, + [ + c_uint64, + ], +) +native_window_taskbar_reset_thumbnail = function( + "native_window_taskbar_reset_thumbnail", + c_bool, + [ + c_uint64, + ], +) native_window_taskbar_add_thumbnail_button = function( "native_window_taskbar_add_thumbnail_button", c_bool, diff --git a/bindings/python/nativeapi/window_taskbar.py b/bindings/python/nativeapi/window_taskbar.py index 593b261..76fc7ae 100644 --- a/bindings/python/nativeapi/window_taskbar.py +++ b/bindings/python/nativeapi/window_taskbar.py @@ -254,6 +254,22 @@ def overlay_icon_description(self) -> str: raw = _C.native_window_taskbar_get_overlay_icon_description(self._handle) return _rt.take_str(raw) + def set_thumbnail(self, thumbnail: _image.Image | None) -> bool: + raw = _C.native_window_taskbar_set_thumbnail( + self._handle, + _rt.handle_of(thumbnail), + ) + return raw + + @property + def thumbnail(self) -> _image.Image | None: + raw = _C.native_window_taskbar_get_thumbnail(self._handle) + return _image.Image._owned(raw) + + def reset_thumbnail(self) -> bool: + raw = _C.native_window_taskbar_reset_thumbnail(self._handle) + return raw + def add_thumbnail_button(self, button: TaskbarThumbnailButton | None) -> bool: raw = _C.native_window_taskbar_add_thumbnail_button( self._handle, diff --git a/bindings/rust/cnativeapi/src/bindings.rs b/bindings/rust/cnativeapi/src/bindings.rs index 4a3887c..176b24d 100644 --- a/bindings/rust/cnativeapi/src/bindings.rs +++ b/bindings/rust/cnativeapi/src/bindings.rs @@ -1229,6 +1229,21 @@ unsafe extern "C" { window_taskbar: native_window_taskbar_t, ) -> *mut ::std::os::raw::c_char; } +unsafe extern "C" { + pub fn native_window_taskbar_set_thumbnail( + window_taskbar: native_window_taskbar_t, + thumbnail: native_image_t, + ) -> bool; +} +unsafe extern "C" { + #[doc = " Caller owns the returned handle; release it with native_image_free()."] + pub fn native_window_taskbar_get_thumbnail( + window_taskbar: native_window_taskbar_t, + ) -> native_image_t; +} +unsafe extern "C" { + pub fn native_window_taskbar_reset_thumbnail(window_taskbar: native_window_taskbar_t) -> bool; +} unsafe extern "C" { pub fn native_window_taskbar_add_thumbnail_button( window_taskbar: native_window_taskbar_t, diff --git a/bindings/rust/nativeapi/src/window_taskbar.rs b/bindings/rust/nativeapi/src/window_taskbar.rs index f21b9f4..1c0340a 100644 --- a/bindings/rust/nativeapi/src/window_taskbar.rs +++ b/bindings/rust/nativeapi/src/window_taskbar.rs @@ -386,6 +386,24 @@ impl WindowTaskbar { } } + pub fn set_thumbnail(&self, thumbnail: Option<&Image>) -> bool { + unsafe { + cnativeapi::native_window_taskbar_set_thumbnail(self.handle, thumbnail.map_or(0, |value| value.as_raw())) + } + } + + pub fn thumbnail(&self) -> Option { + unsafe { + Image::from_raw(cnativeapi::native_window_taskbar_get_thumbnail(self.handle)) + } + } + + pub fn reset_thumbnail(&self) -> bool { + unsafe { + cnativeapi::native_window_taskbar_reset_thumbnail(self.handle) + } + } + pub fn add_thumbnail_button(&self, button: Option<&TaskbarThumbnailButton>) -> bool { unsafe { cnativeapi::native_window_taskbar_add_thumbnail_button(self.handle, button.map_or(0, |value| value.as_raw())) diff --git a/bindings/swift/Sources/NativeAPI/WindowTaskbar.swift b/bindings/swift/Sources/NativeAPI/WindowTaskbar.swift index c340793..cc95e55 100644 --- a/bindings/swift/Sources/NativeAPI/WindowTaskbar.swift +++ b/bindings/swift/Sources/NativeAPI/WindowTaskbar.swift @@ -283,6 +283,20 @@ public class WindowTaskbar { return String(cString: value) } + public func setThumbnail(_ thumbnail: Image?) -> Bool { + return native_window_taskbar_set_thumbnail(nativeHandle, thumbnail?.nativeHandle ?? 0) + } + + public var thumbnail: Image? { + let handle = native_window_taskbar_get_thumbnail(nativeHandle) + guard handle != NATIVE_INVALID_IMAGE else { return nil } + return Image(nativeHandle: handle) + } + + public func resetThumbnail() -> Bool { + return native_window_taskbar_reset_thumbnail(nativeHandle) + } + public func addThumbnailButton(_ button: TaskbarThumbnailButton?) -> Bool { return native_window_taskbar_add_thumbnail_button(nativeHandle, button?.nativeHandle ?? 0) } diff --git a/core b/core index 8d4a4f2..61bbd83 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 8d4a4f2f3d2d889ccc49e269a125e790d44a3dd6 +Subproject commit 61bbd835a1e1d27abfaee22a7c85434fc193da68 diff --git a/specs/window-taskbar.md b/specs/window-taskbar.md index 4ec3cf7..25f8397 100644 --- a/specs/window-taskbar.md +++ b/specs/window-taskbar.md @@ -7,7 +7,7 @@ > 核实基准:2026-12-01 `WindowTaskbar` 控制单个顶层窗口在操作系统任务栏上的表现:5 态进度条、自定义叠加图标、 -缩略图工具栏(最多 7 个可交互按钮)以及闪烁提醒。 +自定义缩略图(保留 Aero Peek 实时预览)、缩略图工具栏(最多 7 个可交互按钮)以及闪烁提醒。 窗口是否出现在任务栏上由既有 `Window::SetVisibleInTaskbar()` / `IsVisibleInTaskbar()` 管理;窗口标题由 `Window::SetTitle()` / `GetTitle()` 管理;跨平台应用级 Dock/Launcher @@ -38,6 +38,13 @@ - **叠加图标**:`SetOverlayIcon(image, description)` 接收 `std::shared_ptr`(`nullptr` 清除)和无障碍描述。Windows 上与 `Application::SetBadgeLabel()` 共享同一 `HWND` 的叠加 槽位,遵循后写入生效语义。 +- **自定义缩略图**:`SetThumbnail(image)` 接收 `std::shared_ptr`(`nullptr` 还原为系统 + 默认),`GetThumbnail()` 返回当前自定义缩略图,`ResetThumbnail()` 等价于 `SetThumbnail(nullptr)`。 + Windows 上通过 DWM `DWMWA_FORCE_ICONIC_REPRESENTATION` / `DWMWA_HAS_ICONIC_BITMAP` 响应 + `WM_DWMSENDICONICTHUMBNAIL`(按比例缩放并铺不透明底色后调用 `DwmSetIconicThumbnail`),同时 + 响应 `WM_DWMSENDICONICLIVEPREVIEWBITMAP`(窗口可见时用 `PrintWindow(..., PW_RENDERFULLCONTENT)` + 并按 `DWMWA_EXTENDED_FRAME_BOUNDS` 裁剪抓取真实画面,最小化或抓取失败时以深色底居中合成封面 + 兜底,再调用 `DwmSetIconicLivePreviewBitmap`),从而在自定义缩略图时保留 Aero Peek 实时预览。 - **缩略图工具栏**:集合方法遵循 `Menu` 约定(`AddThumbnailButton` / `InsertThumbnailButton` / `RemoveThumbnailButton*` / `ClearThumbnailButtons` / `GetAllThumbnailButtons`),上限 7 个 按钮(`WindowTaskbar::GetMaxThumbnailButtonCount()`)。不采用 `vector` 入参以 diff --git a/website/content/api/window_taskbar.json b/website/content/api/window_taskbar.json index a5c470f..eeefa92 100644 --- a/website/content/api/window_taskbar.json +++ b/website/content/api/window_taskbar.json @@ -1326,6 +1326,158 @@ } } }, + { + "key": "WindowTaskbar::SetThumbnail", + "kind": "method", + "doc": { + "summary": "Sets a custom taskbar thumbnail image, or restores the system default.", + "details": "On Windows, enables DWM iconic thumbnail representation so hovering over the taskbar button displays `thumbnail` (aspect-ratio preserved) while retaining Aero Peek live preview: hovering over the thumbnail captures the live window content when visible, or composites a centered preview from `thumbnail` when minimized. Passing nullptr restores the default system thumbnail and live preview.", + "params": [ + { + "name": "thumbnail", + "text": "Image to display as the taskbar thumbnail, or nullptr to restore the system default." + } + ], + "returns": "true if applied; false if unsupported, the image cannot be converted, or the native window is gone.", + "notes": [ + { + "kind": "note", + "text": "Platform availability:\n- macOS: ❌ Not supported - Always returns false.\n- Windows: ✅ Fully supported - DwmSetIconicThumbnail & DwmSetIconicLivePreviewBitmap.\n- Linux: ❌ Not supported - Always returns false.\n- Android: ❌ Not applicable - Always returns false.\n- iOS: ❌ Not applicable - Always returns false.\n- OpenHarmony: ❌ Not applicable - Always returns false." + } + ] + }, + "signatures": { + "cpp": { + "name": "SetThumbnail", + "signature": "bool SetThumbnail(std::shared_ptr thumbnail)" + }, + "csharp": { + "name": "SetThumbnail", + "signature": "public bool SetThumbnail(Image? thumbnail)" + }, + "dart": { + "name": "setThumbnail", + "signature": "bool setThumbnail(Image? thumbnail)" + }, + "go": { + "name": "SetThumbnail", + "signature": "func (wt *WindowTaskbar) SetThumbnail(thumbnail *Image) error" + }, + "js": { + "name": "setThumbnail", + "signature": "setThumbnail(thumbnail: Image | null): boolean" + }, + "python": { + "name": "set_thumbnail", + "signature": "def set_thumbnail(self, thumbnail: _image.Image | None) -> bool:" + }, + "rust": { + "name": "set_thumbnail", + "signature": "pub fn set_thumbnail(&self, thumbnail: Option<&Image>) -> bool" + }, + "swift": { + "name": "setThumbnail", + "signature": "func setThumbnail(_ thumbnail: Image?) -> Bool" + } + } + }, + { + "key": "WindowTaskbar::GetThumbnail", + "kind": "method", + "doc": { + "summary": "Gets the current custom taskbar thumbnail image, or nullptr if using the system default.", + "returns": "Shared pointer to the custom thumbnail Image, or nullptr if unset, unsupported, or the native window is gone.", + "notes": [ + { + "kind": "see", + "text": "SetThumbnail() for platform availability." + } + ] + }, + "signatures": { + "cpp": { + "name": "GetThumbnail", + "signature": "std::shared_ptr GetThumbnail() const" + }, + "csharp": { + "name": "Thumbnail", + "signature": "public Image? Thumbnail" + }, + "dart": { + "name": "thumbnail", + "signature": "Image? get thumbnail" + }, + "go": { + "name": "Thumbnail", + "signature": "func (wt *WindowTaskbar) Thumbnail() *Image" + }, + "js": { + "name": "thumbnail", + "signature": "get thumbnail(): Image | null" + }, + "python": { + "name": "thumbnail", + "signature": "@property\ndef thumbnail(self) -> _image.Image | None:" + }, + "rust": { + "name": "thumbnail", + "signature": "pub fn thumbnail(&self) -> Option" + }, + "swift": { + "name": "thumbnail", + "signature": "var thumbnail: Image?" + } + } + }, + { + "key": "WindowTaskbar::ResetThumbnail", + "kind": "method", + "doc": { + "summary": "Resets the taskbar thumbnail back to the system default preview.", + "details": "Equivalent to calling SetThumbnail(nullptr).", + "returns": "true if reset (including when already using the default) on a supported platform; false if unsupported or the native window is gone.", + "notes": [ + { + "kind": "see", + "text": "SetThumbnail() for platform availability." + } + ] + }, + "signatures": { + "cpp": { + "name": "ResetThumbnail", + "signature": "bool ResetThumbnail()" + }, + "csharp": { + "name": "ResetThumbnail", + "signature": "public bool ResetThumbnail()" + }, + "dart": { + "name": "resetThumbnail", + "signature": "bool resetThumbnail()" + }, + "go": { + "name": "ResetThumbnail", + "signature": "func (wt *WindowTaskbar) ResetThumbnail() error" + }, + "js": { + "name": "resetThumbnail", + "signature": "resetThumbnail(): boolean" + }, + "python": { + "name": "reset_thumbnail", + "signature": "def reset_thumbnail(self) -> bool:" + }, + "rust": { + "name": "reset_thumbnail", + "signature": "pub fn reset_thumbnail(&self) -> bool" + }, + "swift": { + "name": "resetThumbnail", + "signature": "func resetThumbnail() -> Bool" + } + } + }, { "key": "WindowTaskbar::AddThumbnailButton", "kind": "method",