Is your feature request related to a problem? Please describe.
It is quite verbose to create a layout job and then change a parameter that is not in the constructor:
let mut layout = LayoutJob::simple(
// ...
);
layout.halign = egui::Align::Center;
It is also not ideal that this pattern requires the layout to be declared mutable unnecessarily.
Describe the solution you'd like
LayoutJob should have a builder pattern api where it consumes the self and returns a LayoutJob. Eg the above code snippet would be
let layout = LayoutJob::simple(
// ...
).halign(egui::Align::Center);
Describe alternatives you've considered
The only alternative is keeping it as-is. But this is a very simple API change that would bring this struct into step with the rest of egui.
Additional context
N/A
Is your feature request related to a problem? Please describe.
It is quite verbose to create a layout job and then change a parameter that is not in the constructor:
It is also not ideal that this pattern requires the layout to be declared mutable unnecessarily.
Describe the solution you'd like
LayoutJob should have a builder pattern api where it consumes the
selfand returns a LayoutJob. Eg the above code snippet would beDescribe alternatives you've considered
The only alternative is keeping it as-is. But this is a very simple API change that would bring this struct into step with the rest of egui.
Additional context
N/A