// Copyright © SixtyFPS GmbH // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 export component Button { in property text <=> native.text; in property icon <=> native.icon; in property enabled <=> native.enabled; in property checkable <=> native.checkable; in property primary <=> native.primary; in property colorize-icon <=> native.colorize-icon; out property has-focus <=> native.has-focus; out property pressed <=> native.pressed; in-out property checked <=> native.checked; callback clicked <=> native.clicked; accessible-role: button; accessible-enabled: root.enabled; accessible-checkable: root.checkable; accessible-checked: root.checked; accessible-label: root.text; accessible-action-default => { if (root.checkable) { root.checked = !root.checked; } clicked(); } forward-focus: native; HorizontalLayout { native := NativeButton { checkable: false; enabled: true; } } } export component StandardButton { in property kind <=> native.standard-button-kind; in property enabled <=> native.enabled; in property primary <=> native.primary; out property has-focus <=> native.has-focus; out property pressed <=> native.pressed; callback clicked <=> native.clicked; forward-focus: native; HorizontalLayout { native := NativeButton { accessible-role: button; accessible-label: native.text; accessible-action-default => { clicked(); } is-standard-button: true; checkable: false; } } }