// Copyright © SixtyFPS GmbH // SPDX-License-Identifier: MIT import { BaseButton } from "./base_button.slint"; import { Typography } from "../styling/typography.slint"; import { MaterialPalette } from "../styling/material_palette.slint"; export component TextButton { in property icon <=> base.icon; in property text <=> base.text; in property enabled <=> base.enabled; in property tooltip <=> base.tooltip; in property inverse; callback clicked <=> base.clicked; accessible-role: button; accessible-enabled: root.enabled; accessible-label: root.text == "" ? root.tooltip : root.text; accessible-action-default => { base.clicked(); } base := BaseButton { border_radius: root.height / 2; color: root.inverse ? MaterialPalette.inverse_primary : MaterialPalette.primary; } states [ disabled when !root.enabled : { base.color: MaterialPalette.on_surface; base.transparent_background: true; } ] }