KTopBarWidget
kds-plugin-document / Exports / KTopBarWidget
Interface: KTopBarWidget
顶部工具栏控件,显示在顶部栏的控件
Top bar widget, interactive elements displayed at the top of the application
Hierarchy
↳
KTopBarWidget
Table of contents
Methods
- getClickListener
- getHoverListener
- getIcon
- getId
- getMountPoint
- getSubMenuItems
- getText
- getType
- getVisible
- remove
- setClickListener
- setHoverListener
- setIcon
- setMountPoint
- setSubMenuItems
- setText
- setVisible
Methods
getClickListener
▸ getClickListener(): KClickListener
获取控件的点击监听器
Get the click listener of the widget
Returns
Inherited from
Defined in
api.d.ts:6886
getHoverListener
▸ getHoverListener(): KHoverListener
获取悬停事件监听器
Get hover listener of the widget
Returns
当前的悬停事件监听器 (Current hover listener of the widget)
Defined in
api.d.ts:5965
getIcon
▸ getIcon(): string
获取控件图标
Get the icon of the widget
Returns
string
控件的当前图标 (Current icon of the widget)
Defined in
api.d.ts:5949
getId
▸ getId(): string
获取控件的唯一标识符
Unique identifier for the widget
Returns
string
Inherited from
Defined in
api.d.ts:6871
getMountPoint
▸ getMountPoint(): KTopbarItemMountPoint
获取挂载点
Get the mount point of the topbar widget
Returns
挂载点 (Mount point)
Defined in
api.d.ts:5973
getSubMenuItems
▸ getSubMenuItems(): KTopBarSubMenuItem<KClickListener>[]
获取子菜单项
Get sub-menu items of the widget
Returns
KTopBarSubMenuItem<KClickListener>[]
当前的子菜单项数组 (Current array of sub-menu items)
Defined in
api.d.ts:5981
getText
▸ getText(): string
获取控件文本
Get the text of the widget
Returns
string
控件的当前文本内容 (Current text content of the widget)
Defined in
api.d.ts:5957
getType
▸ getType(): KWidgetIdentifier
获取控件的类型
Get the type of the widget
Returns
Inherited from
Defined in
api.d.ts:6863
getVisible
▸ getVisible(): boolean
获取是否可见
get visibility of the widget
Returns
boolean
Inherited from
Defined in
api.d.ts:6909
remove
▸ remove(): void
从界面中移除此控件
Remove this widget from the UI
Returns
void
Inherited from
Defined in
api.d.ts:6893
setClickListener
▸ setClickListener(listener?): void
设置点击监听器
Set the click listener for the widget
Parameters
| Name | Type | Description |
|---|---|---|
listener? | KClickListener | 可选的点击事件监听器 (Optional click event listener) |
Returns
void
Inherited from
Defined in
api.d.ts:6879
setHoverListener
▸ setHoverListener(listener?): void
设置悬停事件监听器
Set hover listener for the widget
Parameters
| Name | Type | Description |
|---|---|---|
listener? | KHoverListener | 悬停事件监听器 (Hover listener) |
Returns
void
Defined in
api.d.ts:5933
setIcon
▸ setIcon(icon): void
设置控件图标
可以是图片链接,也可以是SVG字符串(如:"data:image/svg+xml;charset=utf8,xxx")
Set the icon of the widget
Can be an image URL or an SVG string (e.g., "data:image/svg+xml;charset=utf8,xxx")
Parameters
| Name | Type | Description |
|---|---|---|
icon | string | 图标URL或SVG字符串 (Icon URL or SVG string) |
Returns
void
Defined in
api.d.ts:5909
setMountPoint
▸ setMountPoint(mountPoint): void
设置挂载点
Set the mount point of the topbar widget
Parameters
| Name | Type | Description |
|---|---|---|
mountPoint | KTopbarItemMountPoint | 挂载点 (Mount point) |
Returns
void
Defined in
api.d.ts:5925
setSubMenuItems
▸ setSubMenuItems(subMenus): void
设置子菜单项
Set sub-menu items for the widget
Parameters
| Name | Type | Description |
|---|---|---|
subMenus | KTopBarSubMenuItem<KClickListener>[] | 子菜单项数组 (Array of sub-menu items) |
Returns
void
Defined in
api.d.ts:5941
setText
▸ setText(text): void
设置控件文本
Set the text of the widget
Parameters
| Name | Type | Description |
|---|---|---|
text | string | 显示的文本内容 (Text content to display) |
Returns
void
Defined in
api.d.ts:5917
setVisible
▸ setVisible(visible): void
设置是否可见
Set the visibility of the widget
Parameters
| Name | Type |
|---|---|
visible | boolean |
Returns
void
Inherited from
Defined in
api.d.ts:6902