Skip to main content

KTopBarWidget

kds-plugin-document / Exports / KTopBarWidget

Interface: KTopBarWidget

顶部工具栏控件,显示在顶部栏的控件

Top bar widget, interactive elements displayed at the top of the application

Hierarchy

Table of contents

Methods

Methods

getClickListener

getClickListener(): KClickListener

获取控件的点击监听器

Get the click listener of the widget

Returns

KClickListener

Inherited from

KWidget.getClickListener

Defined in

api.d.ts:6886


getHoverListener

getHoverListener(): KHoverListener

获取悬停事件监听器

Get hover listener of the widget

Returns

KHoverListener

当前的悬停事件监听器 (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

KWidget.getId

Defined in

api.d.ts:6871


getMountPoint

getMountPoint(): KTopbarItemMountPoint

获取挂载点

Get the mount point of the topbar widget

Returns

KTopbarItemMountPoint

挂载点 (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

KWidgetIdentifier

Inherited from

KWidget.getType

Defined in

api.d.ts:6863


getVisible

getVisible(): boolean

获取是否可见

get visibility of the widget

Returns

boolean

Inherited from

KWidget.getVisible

Defined in

api.d.ts:6909


remove

remove(): void

从界面中移除此控件

Remove this widget from the UI

Returns

void

Inherited from

KWidget.remove

Defined in

api.d.ts:6893


setClickListener

setClickListener(listener?): void

设置点击监听器

Set the click listener for the widget

Parameters

NameTypeDescription
listener?KClickListener可选的点击事件监听器 (Optional click event listener)

Returns

void

Inherited from

KWidget.setClickListener

Defined in

api.d.ts:6879


setHoverListener

setHoverListener(listener?): void

设置悬停事件监听器

Set hover listener for the widget

Parameters

NameTypeDescription
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

NameTypeDescription
iconstring图标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

NameTypeDescription
mountPointKTopbarItemMountPoint挂载点 (Mount point)

Returns

void

Defined in

api.d.ts:5925


setSubMenuItems

setSubMenuItems(subMenus): void

设置子菜单项

Set sub-menu items for the widget

Parameters

NameTypeDescription
subMenusKTopBarSubMenuItem<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

NameTypeDescription
textstring显示的文本内容 (Text content to display)

Returns

void

Defined in

api.d.ts:5917


setVisible

setVisible(visible): void

设置是否可见

Set the visibility of the widget

Parameters

NameType
visibleboolean

Returns

void

Inherited from

KWidget.setVisible

Defined in

api.d.ts:6902