1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
2 | // SPDX-License-Identifier: MIT |
3 | |
4 | import { Theme } from "../theme.slint" ; |
5 | |
6 | export component Page inherits Rectangle { |
7 | in property <int> index; |
8 | in property <int> current-index; |
9 | out property <bool> active: index == current-index; |
10 | |
11 | padding-left: 14px; |
12 | padding-right: 14px; |
13 | x: (index - current-index) * self.width; |
14 | width: 100%; |
15 | height: 100%; |
16 | |
17 | animate x { duration: Theme.durations.fast; } |
18 | |
19 | GridLayout { |
20 | padding-left: root.padding-left; |
21 | padding-right: root.padding-right; |
22 | |
23 | @children |
24 | } |
25 | } |