Add a constructor to Text and let the color default to black

We really shouldn't require specifying a color for every Text {} element just in order
to see *some* text.

For Rectangle OTOH transparent is a good default (and thus for Color), hence
this change just to Text.

Right now the constructor bit is also a bit repetitive, this could
perhaps be folded into BuiltinItem to generate the ffi, default impl and
forward to an init function if it exists.
This commit is contained in:
Simon Hausmann 2020-09-16 08:19:08 +02:00
parent dd8e487acc
commit 625cb6c6b8
10 changed files with 41 additions and 18 deletions

View file

@ -359,6 +359,11 @@ 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