[Slate] How do styles work now?

So, a managed to get my slate widget compiling, but I had to cut out a bunch of style related stuff.

I noticed STreeView no longer has a .Style function, is there a particular way I should style them or should I do it from the child widgets?

I was previously creating a style class that extended FEditorStyle, which doesn’t seem to be there anymore, so I’m extending FCoreStyle, which seems to work except that I can’t access the SetStyle function to actually implement it. How should I go about that now?

Thanks :slight_smile:

So FEditorStyle still exists. It was moved into its own module “EditorStyle” you’ll need to add it to your dependencies just like “InputCore”, also possible to the include list in the Build.cs file.

Nick (Epic Games)

So it does, thanks for that Nick :slight_smile:

FYI, we’ve also changed the status quo regarding this. Instead of extending the FEditorStyle you should really be creating your own style class type. You should be doing this whether you are making a game or an engine/editor plugin.

Ideally if you are making a game your game isn’t dependent on the editor style, which makes sense. The editor style is huge and you don’t want to ship that with your game just for a couple font files and pngs you made use of, instead copy those files to your own Content/Slate directory and reference them in your own style.

If you are making an editor plugin then you should reference FEditorStyle where appropriate/required and reference your own plugin specific style for your new resources.

Keeping your style resources separate from editor style is important so your content can be packaged and distributed correctly for release.

I don’t have the code in front of me atm, but you should be able to find lots of examples of how to set up your own style in the code base. I would look at FPluginStyle (I think that’s what it’s called) as an implementation example. Also ShooterGame and PlatformerGame both have their own styles setup.

I did get the feeling that I probably shouldn’t be using something with “editor” in the name, I’ll look into that plugin when I get the chance, thanks :slight_smile: