Closed mitchmindtree closed 6 years ago
Only optional builder method should be added, or Ui've to be redesigned to be build from something like UiSettings? Should alternative constructors be removed in favor of builder?
@lllShamanlll hmmm I've been thinking about this and I'm a little unsure.
Currently, our optional parameters only include:
Theme
So at first, the builder constructor as you mention seemed a little like overkill to me. However I think you're right: I think it might still be the best option as it will allow us to add further optional arguments in the future without breaking the API :+1:
Something like this would be great:
let ui = conrod::UiBuilder::new()
.theme(my_theme)
.widget_capacity(2048)
.build();
The problme here i've got, we've to pass theme somehow to Ui while building. so it've to be Cloneable, or user've to be pushed to use Rc.
Mb there's other aproach to do that?
The problem with Cloned is: 'WidgetDefaults' can't be Cloned due to 'style' field, wich is Box
Closing as this has been implemented for a while.
This will make it one step easier by not having to import or construct a Theme for users who just want to get up and running.