slint/ui-libraries/material/ui/components/modal.slint
2025-09-18 15:47:22 +02:00

28 lines
703 B
Text

// Copyright © SixtyFPS GmbH <info@slint.dev>
// 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;
}
}
}