[Bugs bugs bugs] Slate widget synchronization

Not a question, just feedback.

Many slate (U) widgets use setter methods to set their style properties and then sync to their (S) widget. Take a look at a few of those (U) widgets and see how half the properties do not synchronize or have such a setter method. Calling SynchronizeProperties() Manually is not an option, because the slate classes do not check if it is safe to do so by testing if their (S) widget is valid. Checking if their (S) Widget is valid manually is not an option, because in some cases (throbber widget) that property is private.

I haven’t got many good things to say about slate’s current design but someone needs to fix the current implementation. Some properties set from the editor panel don’t even update until the widget is recompiled.

Post made for Unreal Engine 4.27. I see improvements in UE 5.1

UE5.1.1 it’s still ■■■, look at the list view and scroll box. unbelievable. Have to rebuild and synchronize a widget to update a single property.

SetText to something, then get nothing when calling GetText.
Congratulations.

FText UEditableTextBox::GetText() const
{
	if ( MyEditableTextBlock.IsValid() )
	{
		return MyEditableTextBlock->GetText();
	}

	return Text;
}

void UEditableTextBox::SetText(FText InText)
{
	// We detect if the Text is internal pointing to the same thing if so, nothing to do.
	if (GetText().IdenticalTo(InText))
	{
		return;
	}

	Text = InText;

	BroadcastFieldValueChanged(FFieldNotificationClassDescriptor::Text);

	if ( MyEditableTextBlock.IsValid() )
	{
		MyEditableTextBlock->SetText(Text);
	}
}

Workaround: Manually “update” the text when text is committed… This is required when the text was “set” by typing into the editable text box, after which the getter returns nothing unless you call SetText like this yourself:


if (IsValid(EditableTextBoxWidget)) {
	EditableTextBoxWidget->OnTextCommitted.AddDynamic(this, &UMyWidget::ActOnEditableTextBoxCommitted);
}

void UMyWidget::ActOnEditableTextBoxCommitted(const FText& Text, ETextCommit::Type CommitMethod) {
	EditableTextBoxWidget->TakeWidget();
	EditableTextBoxWidget->SetText(Text);
}

Update UE5.2.1 Above workaround does not work anymore, the getter will return an empty value.
The story continues > [UE5.2.1, Bug report] EditableTextBox broke further. GetText not returning set value.

UE5, text block visibility within an input key selector does not synchronize at all. Data lost on widget rebuild as well.

UE5.2 updates a bunch of slate widgets with new getters and setters, deprecating direct access to many properties. This is very good, because we need setters to sync Slate.

EPIC please test it properly because the editable text box and spinbox are already broken (see previous posts). Other than that, it’s good to see improvements on the synchronization process between Slate and UMG so that I am not forced to rebuild my widgets all the time after changing a single style property.

In 5.2, various getter / setter methods are still missing, though direct property access has already been deprecated. Please add these:

  • ComboBoxKey::ForegroundColor;
  • ComboBoxString::ForegroundColor;
  • ComboBoxString::Font;
  • UScrollBox::BackPadScrolling;
  • UScrollBox::FrontPadScrolling;
  • UScrollBox::NavigationScrollPadding;

For whatever reason there are two setters for this one, one is unsafe to call:

void UInputKeySelector::SetButtonStyle( const FButtonStyle* InButtonStyle )
{
	SetButtonStyle(*InButtonStyle);
}

Another gift

[UE5.2, Bug report] Good job, you broke SetValue on the slider this time

[UE5.2.1, Bug report] EditableTextBox broke further. GetText not returning set value.