mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-26 18:06:26 +00:00
28 lines
703 B
Text
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;
|
|
}
|
|
}
|
|
}
|