[Epic] Ways to Re-Use Widget Styles,

We have these asset types:


Which we can reference inside a UUserWidget as a soft class reference. So that is a bit awkward for designers if they first have to construct an object from these classes, pull the data, set the data, it’s too many steps for hundreds of widgets.

But this is a step in the right direction to easily re-use things like font sizes, font colors and paddings through the entire app.

I’d rather have that data in datatables, but it looks like this is not supported.

I’m actually looking for the fastest way to import a slate style onto an original UWidget, like a single dropdown, which doesn’t require designers to mess around with logic or VS. Any out of the box solutions?

1 Like

I’d rather have that data in datatables, but it looks like this is not supported.

The above is a wrapper for the data. The DT can reference the actual data struct instead - called Button Style (for a button). Combine it with an enumerator and you have a dropdown.

Would that work?

2 Likes

I went with this:

You can hide most of the parameters. Unreal crashed when I hid “Accessibility” and “Layout” you will want to keep.
You can go pretty wild with these and define all of these default UMG classes and then make children of these and children of these to narrow it down.
Perhaps there is a way to automate it all from a csv/json file through one of the subsystems or some editor programming?

Then there is this:

2 Likes

This has the advantage that designers can do everything in the UMG editor from one place, but a bunch of child classes have to be created :/.

Technically yes but now you have a struct in a struct cause the original is not supported with BP datatables. It’s also still a multi step process to import them onto the widget. Of course things can be automated through a function but I don’t think we have found the best way yet.

What about this? This gets closer to a web - like stylesheet approach.

1 Like

Sort of like an automated CSS pipeline?

Sort of yes, optimally using what the engine already got. It would be amazing to be able to edit styles the way designers are used to while writing their modifications to a single file. bit like the last image I posted. Currently I’m researching if it makes sense to use those slate assets as templates and write to their CDO from c++ when the editor changes. might be it. But there could be a better way.

I’m marking this as solved for now. I spent all day researching old slate code and I am now working on my own automation system which doesn’t require any extra steps.

1 Like