mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-29 21:34:50 +00:00
Change the way Text's default color is implemented
Instead of via an item constructor, implement support for default bindings in the compiler.
This commit is contained in:
parent
04e2910344
commit
ad77896312
8 changed files with 87 additions and 48 deletions
|
@ -368,11 +368,6 @@ Flickable::~Flickable()
|
|||
sixtyfps_flickable_data_free(&data);
|
||||
}
|
||||
|
||||
Text::Text()
|
||||
{
|
||||
sixtyfps_text_init(this);
|
||||
}
|
||||
|
||||
namespace private_api {
|
||||
template<int Major, int Minor, int Patch>
|
||||
struct VersionCheckHelper
|
||||
|
|
|
@ -145,6 +145,15 @@ public:
|
|||
/// false otherwise.
|
||||
friend bool operator!=(const Color &lhs, const Color &rhs) { return !(lhs == rhs); }
|
||||
|
||||
/// Writes the \a color to the specified \a stream and returns a reference to the
|
||||
/// stream.
|
||||
friend std::ostream &operator<<(std::ostream &stream, const Color &color)
|
||||
{
|
||||
// Cast to uint to avoid the components being interpreted as char.
|
||||
return stream << "argb(" << uint(color.inner.alpha) << ", " << uint(color.inner.red) << ", "
|
||||
<< uint(color.inner.green) << ", " << uint(color.inner.blue) << ")";
|
||||
}
|
||||
|
||||
private:
|
||||
cbindgen_private::types::Color inner;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue