slint/internal/compiler/tests/syntax/lookup/deprecated_property.slint
Simon Hausmann 8761eaadeb
Move Palette.style-name to internal protected StyleMetrics.style-name (#8200)
This is only exposed when internal types are exposed (such as in the lsp).

The plan is to make this public under a new name/global after the release.

Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2025-04-19 10:20:52 +02:00

42 lines
1.8 KiB
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 { StyleMetrics } from "std-widgets.slint";
export 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}
debug(StyleMetrics.dark-color-scheme);
// ^warning{The property 'dark-color-scheme' has been deprecated. Please use 'Palette.dark-color-scheme' instead}
// not deprecated
debug(StyleMetrics.layout-padding, StyleMetrics.layout-padding);
background = StyleMetrics.window-background;
// ^warning{The property 'window-background' has been deprecated. Please use 'Palette.window-background' instead}
// Not really a deprecation test, but handled in the same function :)
debug(StyleMetrics.style-name);
// ^error{'StyleMetrics' does not have a property 'style-name'}
}
}