// Copyright © SixtyFPS GmbH // SPDX-License-Identifier: MIT import { MaterialPalette } from "../styling/material_palette.slint"; import { Animations } from "../styling/animations.slint"; export component Modal { callback clicked <=> touch_area.clicked; background_layer := Rectangle { clip: true; touch_area := TouchArea { @children } animate background { duration: Animations.opacity_duration; easing: Animations.opacity_easing; } } Timer { interval: 50ms; triggered => { background_layer.background = MaterialPalette.background_modal; self.running = false; } } }