文件最后提交记录最后更新时间
docs: add OHOS API documentation (1290 APIs, 66 modules) Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
README.md

Tray API 列表

本模块包含 35 个 API。

Events(事件)

API 说明 鸿蒙支持
click 在托盘图标被点击时触发。 支持
right-click 在托盘图标被右键点击时触发。 不支持
double-click 在托盘图标被双击时触发。 不支持
middle-click 在托盘图标被鼠标中键点击时触发。 不支持
balloon-show 在托盘气泡通知显示时触发。 不支持
balloon-click 在托盘气泡通知被点击时触发。 不支持
balloon-closed 在托盘气泡通知因超时或用户手动关闭时触发。 不支持
drop 在任意拖拽内容被放置到托盘图标上时触发。 不支持
drop-files 在拖拽的文件被放置到托盘图标上时触发。 不支持
drop-text 在拖拽的文本被放置到托盘图标上时触发。 不支持
drag-enter 在拖拽操作进入托盘图标范围时触发。 不支持
drag-leave 在拖拽操作离开托盘图标范围时触发。 不支持
drag-end 在拖拽操作在托盘上结束或在其他位置结束时触发。 不支持
mouse-up 在鼠标点击托盘图标后松开时触发。 不支持
mouse-down 在鼠标点击托盘图标时触发。 不支持
mouse-enter 在鼠标进入托盘图标区域时触发。 不支持
mouse-leave 在鼠标离开托盘图标区域时触发。 不支持
mouse-move 在鼠标在托盘图标上移动时触发。 不支持

Methods(方法)

API 说明 鸿蒙支持
new Tray(image, [guid]) 创建与指定图像关联的托盘图标。 支持
tray.destroy() 立即销毁托盘图标。 支持
tray.setImage(image) 设置托盘图标的图像。 支持
tray.setPressedImage(image) 设置在 macOS 上按下托盘图标时显示的图像。 不支持
tray.setToolTip(toolTip) 设置托盘图标的悬停提示文本。 支持
tray.setTitle(title[, options]) 设置状态栏中托盘图标旁显示的标题(支持 ANSI 颜色)。 不支持
tray.getTitle() 返回 string,即状态栏中托盘图标旁显示的标题。 不支持
tray.setIgnoreDoubleClickEvents(ignore) 设置是否忽略双击事件,忽略后可检测到每次单独的托盘图标点击。 不支持
tray.getIgnoreDoubleClickEvents() 返回 boolean,表示是否忽略双击事件。 不支持
tray.displayBalloon(options) 显示托盘气泡通知。 不支持
tray.removeBalloon() 移除托盘气泡通知。 不支持
tray.focus() 将焦点返回到任务栏通知区域。 不支持
tray.popUpContextMenu([menu, position]) 弹出托盘图标的上下文菜单,若传入 menu 则显示该菜单而非托盘默认菜单。 不支持
tray.closeContextMenu() 关闭由 tray.setContextMenu() 设置的已打开的上下文菜单。 不支持
tray.setContextMenu(menu) 设置托盘图标的上下文菜单。 支持
tray.getBounds() 返回 Rectangle,表示托盘图标的边界区域。 不支持
tray.isDestroyed() 返回 boolean,表示托盘图标是否已被销毁。 支持