mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-27 10:26:12 +00:00
40 lines
995 B
Text
40 lines
995 B
Text
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
|
|
|
import { StandardButton, Button, GridBox } from "std-widgets.slint";
|
|
|
|
TestCase := Dialog {
|
|
Rectangle {
|
|
background: red;
|
|
preferred-width: 600px;
|
|
preferred-height: 600px;
|
|
}
|
|
forward-focus: ok-button;
|
|
|
|
StandardButton { kind: help; }
|
|
ok-button := StandardButton { kind: ok; }
|
|
StandardButton { kind: cancel; }
|
|
StandardButton { kind: apply; }
|
|
StandardButton { kind: reset; }
|
|
StandardButton { kind: yes; }
|
|
Button {
|
|
text: "Action";
|
|
dialog-button-role: action;
|
|
}
|
|
}
|
|
|
|
/*
|
|
```rust
|
|
let instance = TestCase::new().unwrap();
|
|
instance.on_help_clicked(|| { dbg!() });
|
|
instance.on_cancel_clicked(|| { dbg!() });
|
|
```
|
|
|
|
```cpp
|
|
auto handle = TestCase::create();
|
|
const TestCase &instance = *handle;
|
|
instance.on_help_clicked([] { });
|
|
instance.on_cancel_clicked([] { });
|
|
```
|
|
|
|
*/
|