// Copyright © SixtyFPS GmbH // SPDX-License-Identifier: MIT import { Elevation } from "./elevation.slint"; import { BaseButton } from "./base_button.slint"; import { Typography } from "../styling/typography.slint"; import { MaterialPalette } from "../styling/material_palette.slint"; export component FilledButton { in property icon <=> base.icon; in property text <=> base.text; in property tooltip <=> base.tooltip; in property enabled <=> base.enabled; callback clicked <=> base.clicked; accessible-role: button; accessible-enabled: root.enabled; accessible-label: root.text == "" ? root.tooltip : root.text; accessible-action-default => { base.clicked(); } elevation := Elevation { border_radius: root.height / 2; background: MaterialPalette.primary; width: 100%; height: 100%; } base := BaseButton { border_radius: elevation.border_radius; color: MaterialPalette.on_primary; } states [ disabled when !root.enabled : { elevation.background: transparent; base.color: MaterialPalette.on_surface; } hover when base.has_hover && !base.pressed && !base.enter_pressed : { elevation.level: 1; } ] }