Skip to content

sirjofri/SlateStyleBrowser

Repository files navigation

Slate Style Browser

This small tool lets you browse Unreal Engine's Slate styles easily, search for specific ones and copy slate code for the selected style or brush.

Screenshot of the window

Invocation

When the plugin is activated there's only one window which you can open via Tools -> Slate Style Browser.

Features

Searching

Using the search bar it's possible to filter the styles based on their names.

You may enter multiple words (separated by space) for (case-insensitive) filtering, as well as tuples for filtering details; for example:

  • Check Doc will search for all property names that include Check and Doc.
  • ResourceName= will be ignored (no value!)
  • ResourceName=Check will search for all entries that contain a details field that matches ResourceName and which value contains Check, for example, a brush with the Resource Name of ../checkerboard.svg.

Filtering happens automatically after entering text, with a short delay to reduce lags.

Select a Style Set

Using a dropdown menu you can select another style set besides the default Editor style.

Select a Style Type

The tool supports various different types, which you can select using another dropdown menu.

Copying Slate Code

Slate Style Browser supports multiple code copying styles you can set up and use. In addition to your custom presets, you can always type some quick style right into the tool window.

To adjust the presets:

  • EditEditor Preferences
  • PluginsSlate Style Browser
  • Configure as you like (see also: Configuration)

To reset the configuration to a default, you first have to check the Allow Reset to Default checkbox, then click the Reset to Defaults button.

Within the copy styles, there are a few placeholders that will be replaced:

  • $1 is the property name
  • $2 is the style set name
  • $3 is the widget style type
  • $$ is just $

In addition to that, there are generic replacements that can help to:

  • replace FSlateStyleRegistry::FindSlateStyle("AppStyle") with FAppStyle::Get()
  • replace FSlateStyleRegistry::FindSlateStyle("CoreStyle") with FCoreStyle::Get()
  • etc.

As with everything source-code related you are supposed to read it before you include it and adjust it to make it work in your environment.

Configuration

(Editor PreferencesPluginsSlate Style Browser)

  • Allow Reset to Default: Check to make the Reset to Defaults button work.
  • Copy Styles: Per type, set preset copy styles here.
  • Readability Replacements: Automatically replace text to enhance readability of copied code.

The configuration is saved in the EditorSettings configuration file on your system, usually in %localappdata%\UnrealEngine\5.x\Saved\Config\WindowsEditor\EditorSettings.ini.


Source Code and License

The source code is licensed under the MIT license and is hosted at https://github.com/sirjofri/SlateStyleBrowser. See also the License.txt file inside the repository for the full license text.