SmartTableStyle.h

One asset carrying every brush and text style a table wears.

Source/SmartTables/Public/SmartTableStyle.h

What a table looks like, in one asset.

Every field here sits on USmartTable as well, which is fine for one table and wrong for twenty. An asset set on a table covers the table's own values while it is set, and clearing the asset puts them back. A table with no asset carries on with what its Details panel says.

The class defaults are also the look a table opens with. The constructor builds most fields from the palette in Project Settings, and USmartTable copies the lot. A default FSlateBrush is a solid white box and not an empty one, so a field the constructor skipped would draw white over whatever is under it.

Class
USmartTableStyle
Extends
UDataAsset
Members
29
Panel fields
27

Default constructor 1

Default constructorUSmartTableStyle

Public functions 1

BuildDefaultsFromSettings
void BuildDefaultsFromSettings()

Builds the whole look out of the palette in Project Settings. The constructor is one call to this.

Public so a palette edit can run it again on the class defaults, which is what puts a colour change on screen without opening the editor again. Nothing runs it on an asset: that would throw away every field the asset was authored with.

Public variables 18

Surfaces 4

Background BrushBackgroundBrushpanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Surfaces" ) FSlateBrush BackgroundBrush

Behind the rows, under everything else the table draws.

Row StyleRowStylepanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Surfaces" ) FTableRowStyle RowStyle

Every row surface: the banded backgrounds, hovered, selected, and selected while the table has no focus. The text colours of a row live on it too.

Header StyleHeaderStylepanel
UPROPERTY( EditAnywhere, Category = "Smart Tables|Surfaces", meta = ( ToolTip = "The header row: its background, the rule under it, the splitter between columns, and the sort arrows. The column labels take the header text style instead." ) ) FHeaderRowStyle HeaderStyle

The header row: its background, the rule under it, the column splitter, and the sort arrows.

EditAnywhere and never BlueprintReadWrite. FHeaderRowStyle carries no BlueprintType, so UHT refuses a reflected read write on it. The table's own copy is declared the same way.

Scroll Bar StyleScrollBarStylepanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Surfaces", meta = ( ToolTip = "Both scrollbars: the one down the side and the one along the bottom. The track behind them takes its colour from here as well." ) ) FScrollBarStyle ScrollBarStyle

Both scrollbars: the one down the side and the one along the bottom. The engine bar is near white, which on a dark table draws lighter than anything else, so this one starts grey.

Drag and Drop 2

Drag Source BrushDragSourceBrushpanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Drag and Drop", meta = ( ToolTip = "Drawn over the cell a drag started on, and never instead of it. The cell goes on drawing itself underneath, so the tint has to be see through." ) ) FSlateBrush DragSourceBrush

Drawn over the cell a drag started on, and never instead of it.

The cell goes on drawing itself underneath, so a cell class this plugin has never seen is marked the same as a stock one. A dark tint by default: what that cell holds is already under the cursor.

Drag Target BrushDragTargetBrushpanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Drag and Drop" ) FSlateBrush DragTargetBrush

Drawn over the cell a release would drop on. An outline and no tint by default, so what is in that cell stays readable while the drop is being decided.

Text 4

Header Text StyleHeaderTextStylepanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Text" ) FTextBlockStyle HeaderTextStyle

The column labels, smaller and dimmer and upper case by default. The sort arrow beside a label takes its colour from here as well.

Cell Text StyleCellTextStylepanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Text" ) FTextBlockStyle CellTextStyle

The text in every built-in text cell. A cell class of its own is free to read it or leave it.

Row Number Text StyleRowNumberTextStylepanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Text", meta = ( ToolTip = "The text in the pinned row number column. Dimmer than the cell text by default." ) ) FTextBlockStyle RowNumberTextStyle

The text in the pinned row number column. Dimmer than the cell text by default: a row number points at a row instead of being one of its values.

Empty Text StyleEmptyTextStylepanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Text" ) FTextBlockStyle EmptyTextStyle

The line drawn where a table has no rows, and the line for a filter that matched none.

Details 6

Insert Marker BrushInsertMarkerBrushpanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Details" ) FSlateBrush InsertMarkerBrush

The bar that says where a dragged column will end up.

Row Insert Marker BrushRowInsertMarkerBrushpanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Details", meta = ( ToolTip = "The bar that says where dragged rows will land, across the edge between two rows. Its image height is what the bar draws at." ) ) FSlateBrush RowInsertMarkerBrush

The bar that says where dragged rows will land, drawn across the edge between two rows.

Its own brush, never shared with the column marker. The height here is read off the brush and is what the bar draws at, where the column marker takes its width from a constant.

Column Divider BrushColumnDividerBrushpanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Details" ) FSlateBrush ColumnDividerBrush

The line between two columns. The header cell draws it over itself, so no column gives up width for it and no row draws it at all.

Column Caret BrushColumnCaretBrushpanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Details", meta = ( ToolTip = "The bar under the label of the column input is aimed at. The dragged column marker is a separate brush and can be on screen at the same moment." ) ) FSlateBrush ColumnCaretBrush

The bar under the label of the column input is aimed at.

Apart from the dragged column marker, and warm where that one is cold by default. Both can be on screen at the same moment, and one colour across the two would read as the drag landing here.

Focus Border BrushFocusBorderBrushpanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Details" ) FSlateBrush FocusBorderBrush

Drawn over the whole table while it holds keyboard focus. It sits in a slot of its own and hit tests nothing, so it takes no room and eats no click.

Busy Overlay BrushBusyOverlayBrushpanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Details" ) FSlateBrush BusyOverlayBrush

Drawn over the rows while the model is busy, with a spinner in the middle of it. See through by default, which keeps the rows readable underneath.

Menu 1

Metrics 1

Header HeightHeaderHeightpanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Metrics", meta = ( ToolTip = "How tall the header row draws, in pixels. It sets the height of every header cell, the pinned row number column with them.", ClampMin = "0.0" ) ) float HeaderHeight = 26.0f
Minimum
0.0

How tall the header row draws, in pixels. It sets the height of every header cell, the pinned row number column with them.

FSmartTableMenuStyle struct

What the header menu looks like, and the row menu with it.

A menu draws in a window of its own, over whatever is under it, the table included. Its background has to be solid, or what is behind shows through. One step off the table's own too, so the two read as two surfaces and not as one with a seam down it.

Only the parts a skin has a view about are here. Every other Menu key falls through to the engine's own style, so a key a later engine adds goes on drawing instead of turning into a missing texture box.

Public variables 7

Background BrushBackgroundBrushpanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Menu" ) FSlateBrush BackgroundBrush

Behind the whole menu, under the entries and the group titles. Anything see through here lets the game show through the menu.

Entry StyleEntryStylepanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Menu" ) FButtonStyle EntryStyle

One entry, in its normal, hovered and pressed states.

Label Text StyleLabelTextStylepanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Menu" ) FTextBlockStyle LabelTextStyle

The text of one menu entry. The group titles take the heading style instead.

Search HighlightSearchHighlightpanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Menu" ) FSmartTableSearchHighlight SearchHighlight

How a menu marks the letters that match its search. Greyed out on a table where a right click opens no menu, on the header or on a row.

Heading Text StyleHeadingTextStylepanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Menu" ) FTextBlockStyle HeadingTextStyle

The group titles, such as Sort and Columns.

Separator BrushSeparatorBrushpanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Menu" ) FSlateBrush SeparatorBrush

The line between two groups.

Check StyleCheckStylepanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Menu" ) FCheckBoxStyle CheckStyle

The tick beside a toggled entry. The Show Columns flyout is nothing but these.

FSmartTableSearchHighlight struct

How a menu marks the letters of an entry that match its search.

The mark is a fill and an outline, each switched on its own. Both take the colour of the label text and draw see through. That colour already reads against the menu. The background shows through the mark, a hovered entry included. Each part draws lighter while the other is on.

A label colour set to Inherit has no colour of its own to take. The HighlightShape of the label style draws then instead.

Public variables 2

FillbFillpanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Menu", meta = ( ToolTip = "Fill the letters that match a search, in the label colour and see through. With Outline also off, nothing marks a match." ) ) bool bFill = true

Fill the letters that match a search, in the label colour and see through. With Outline also off, nothing marks a match.

OutlinebOutlinepanel
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Smart Tables|Menu", meta = ( ToolTip = "Draw a thin line around the letters that match a search, in the label colour. With Fill also off, nothing marks a match." ) ) bool bOutline = true

Draw a thin line around the letters that match a search, in the label colour. With Fill also off, nothing marks a match.

Next: SmartTableSettings.h