mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-29 13:24:48 +00:00

* Added TodoMVC example (Rust mock version) * TodoMVC: use visible-width instead of width for selection items and format * TodoMVC: layout fix for qt checkbox * TdodoMVC: fix license issues in the example * Update examples/todo_mvc/ui/views/task_list_view.slint Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * TdodoMVC: fix license issues in the example * TodoMVC: code review changes * TodoMVC: code review changes * Update .reuse/dep5 Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev> * Update examples/todo_mvc/rust/src/adapters/navigation_adapter.rs Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev> * Update examples/todo_mvc/rust/src/adapters/navigation_adapter.rs Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev> * TodoMVC: refactor task list model (code review feedback) * TodoMVC: code review feedback * Update examples/todo-mvc/rust/src/mvc/controllers/task_list_controller.rs Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * TodoMVC: add missing link in dep5 * dep5 fix --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
47 lines
1.2 KiB
Text
47 lines
1.2 KiB
Text
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
import { TaskListView, TaskListAdapter } from "./views/task_list_view.slint";
|
|
export { TaskListAdapter }
|
|
|
|
import { CreateTaskView, CreateTaskAdapter } from "./views/create_task_view.slint";
|
|
export { CreateTaskAdapter }
|
|
|
|
import { AnimationSettings } from "./widgets/styling.slint";
|
|
|
|
export global NavigationAdapter {
|
|
out property <int> current-page;
|
|
|
|
public function next-page() {
|
|
root.current-page += 1;
|
|
}
|
|
|
|
public function previous-page() {
|
|
root.current-page = max(0, root.current-page - 1);
|
|
}
|
|
}
|
|
|
|
export component MainWindow inherits Window {
|
|
preferred-width: 400px;
|
|
preferred-height: 600px;
|
|
title: "Slint todo mvc example";
|
|
|
|
layout := HorizontalLayout {
|
|
x: -(NavigationAdapter.current-page * root.width);
|
|
|
|
TaskListView {
|
|
width: root.width;
|
|
height: root.height;
|
|
}
|
|
|
|
CreateTaskView {
|
|
width: root.width;
|
|
height: root.height;
|
|
}
|
|
|
|
animate x {
|
|
duration: AnimationSettings.move-duration;
|
|
easing: AnimationSettings.move-easing;
|
|
}
|
|
}
|
|
}
|