// SPDX-FileCopyrightText: 2024 vivi developers // SPDX-License-Identifier: MIT import { ButtonStyle } from "../foundation.slint"; import { ButtonAction } from "./magic_button_base.slint"; import { MagicText } from "./magic_text.slint"; import { MagicIcon } from "./magic_icon.slint"; import { OutlineButton } from "./outline_button.slint"; import { MagicPalette, MagicFontSettings, MagicIconSettings, MagicSizeSettings, MagicLayoutSettings, MagicBorderSettings } from "./styling.slint"; export component FilledButton inherits OutlineButton { in property action; property default_style: { border_style: { background: MagicPalette.control_background, border_radius: MagicBorderSettings.control_border_radius, }, text_style: { font_size: MagicFontSettings.body.font_size, font_weight: MagicFontSettings.body.font_weight, foreground: MagicPalette.control_foreground, }, icon_style: { icon_size: MagicIconSettings.body.icon_size, foreground: MagicPalette.control_foreground, }, layout_style: MagicLayoutSettings.control_style }; property primary_style: { border_style: { background: MagicPalette.accent_background, border_radius: MagicBorderSettings.control_border_radius, }, text_style: { font_size: MagicFontSettings.body.font_size, font_weight: MagicFontSettings.body.font_weight, foreground: MagicPalette.accent_foreground, }, icon_style: { icon_size: MagicIconSettings.body.icon_size, foreground: MagicPalette.accent_foreground, }, layout_style: MagicLayoutSettings.control_style }; property destructive_style: { border_style: { background: MagicPalette.destructive_background, border_radius: MagicBorderSettings.control_border_radius, }, text_style: { font_size: MagicFontSettings.body.font_size, font_weight: MagicFontSettings.body.font_weight, foreground: MagicPalette.destructive_foreground, }, icon_style: { icon_size: MagicIconSettings.body.icon_size, foreground: MagicPalette.destructive_foreground, }, layout_style: MagicLayoutSettings.control_style }; style: root.action == ButtonAction.default ? root.default_style : root.action == ButtonAction.primary ? root.primary_style : root.destructive_style; }