StandardButton
StandardButton 看起来像一个按钮,但无需使用 text 和 icon 进行自定义,
它可以采用预定义的 kind 之一,文本和图标将取决于样式。
enabled
Section titled “enabled”booldefault: true
默认为 true。当为 false 时,按钮无法被按下
has-focus
Section titled “has-focus”bool(out)
当按钮当前具有焦点时设置为 true
enum StandardButtonKinddefault: ok
按钮的种类,为 ok cancel、apply、close、reset、help、yes、no,、abort、retry 或 ignore 之一
StandardButton { kind: ok;}slint
primary
Section titled “primary”booldefault: false
如果设置为 true,按钮将使用主强调色显示。
pressed
Section titled “pressed”bool(out)
当按钮被按下时设置为 true。
clicked()
Section titled “clicked()”在以下情况调用:手指或鼠标左键在此元素上按下,然后释放。
StandardButton { clicked() => { debug("Button clicked"); }}slint
© 2026 SixtyFPS GmbH