mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 14:51:15 +00:00

This change adds `KeyPress` and `KeyRelease` variants to the `WindowEvent` enum, along with the new `slint::Key` enum, that allows encoding keys.
37 lines
1.3 KiB
Text
37 lines
1.3 KiB
Text
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
|
|
|
Xxx := Rectangle {
|
|
color: white;
|
|
// ^warning{The property 'color' has been deprecated. Please use 'background' instead}
|
|
|
|
r := Rectangle {
|
|
background: root.color;
|
|
// ^warning{The property 'color' has been deprecated. Please use 'background' instead}
|
|
animate color {
|
|
// ^warning{The property 'color' has been deprecated. Please use 'background' instead}
|
|
duration: 250ms;
|
|
}
|
|
}
|
|
|
|
minimum-height: root.maximum-width;
|
|
// ^warning{The property 'minimum-height' has been deprecated. Please use 'min-height' instead}
|
|
// ^^warning{The property 'maximum-width' has been deprecated. Please use 'max-width' instead}
|
|
|
|
callback not_called;
|
|
not_called() => {
|
|
color = #000000;
|
|
// ^warning{The property 'color' has been deprecated. Please use 'background' instead}
|
|
}
|
|
|
|
Foo := FocusScope {
|
|
key-pressed(event) => {
|
|
if (event.text == Keys.Escape) {
|
|
// ^warning{The property 'Keys' has been deprecated. Please use 'Key' instead}
|
|
debug("Esc key was pressed")
|
|
}
|
|
accept
|
|
}
|
|
}
|
|
|
|
}
|