mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 22:31:14 +00:00
C++: fix creating a gradient from a const reference to a color
This commit is contained in:
parent
c2433d0f0b
commit
0a46b367e2
2 changed files with 5 additions and 1 deletions
|
@ -177,7 +177,7 @@ public:
|
|||
|
||||
#if !defined(DOXYGEN)
|
||||
// FIXME: we need this to create GradientStop
|
||||
operator const cbindgen_private::types::Color &() { return inner; }
|
||||
operator const cbindgen_private::types::Color &() const { return inner; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
|
|
@ -14,5 +14,9 @@ Test := Rectangle {
|
|||
background: @linear-gradient(45deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
|
||||
property <color> foo: #a23;
|
||||
property <brush> bar: @linear-gradient(1.2rad, foo.darker(0.5), foo.brighter(0.5), );
|
||||
|
||||
for data in [{xx: #b56}] : Rectangle {
|
||||
background: @linear-gradient(1.2rad, data.xx, blue);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue