1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
2 | // SPDX-License-Identifier: MIT |
3 | |
4 | import { Theme } from "../theme.slint" ; |
5 | |
6 | export component StateLayer inherits TouchArea { |
7 | in property <length> border-radius <=> i-container.border-radius; |
8 | |
9 | width: 100%; |
10 | height: 100%; |
11 | |
12 | states [ |
13 | pressed when root.pressed : { |
14 | i-container.opacity: 0.12; |
15 | } |
16 | ] |
17 | |
18 | i-container := Rectangle { |
19 | width: 100%; |
20 | height: 100%; |
21 | background: Theme.palette.pure-black; |
22 | opacity: 0.0; |
23 | |
24 | animate background { duration: Theme.durations.medium; } |
25 | } |
26 | } |