Fix checkbox style on editor utility widgets.

#jira UE-117887
#rb Vincent.Gauthier
#preflight 6148f759315f54000134958f

[CL 17576768 by daren cheng in ue5-main branch]
This commit is contained in:
daren cheng
2021-09-20 18:38:24 -04:00
parent cbf9f93b0c
commit 36cbbda965
21 changed files with 73 additions and 0 deletions

View File

@@ -39,6 +39,8 @@ public:
return bAutoRunDefaultAction;
}
virtual bool IsEditorUtility() const override { return true; }
protected:
UPROPERTY(Category = Config, EditDefaultsOnly, BlueprintReadWrite, AssetRegistrySearchable)
FString HelpText;

View File

@@ -262,7 +262,17 @@ struct SLATECORE_API FCheckBoxStyle : public FSlateWidgetStyle
UndeterminedImage.UnlinkColors();
UndeterminedHoveredImage.UnlinkColors();
UndeterminedPressedImage.UnlinkColors();
BackgroundImage.UnlinkColors();
BackgroundHoveredImage.UnlinkColors();
BackgroundPressedImage.UnlinkColors();
ForegroundColor.Unlink();
HoveredForeground.Unlink();
PressedForeground.Unlink();
CheckedForeground.Unlink();
CheckedHoveredForeground.Unlink();
CheckedPressedForeground.Unlink();
UndeterminedForeground.Unlink();
BorderBackgroundColor.Unlink();
}
};

View File

@@ -44,6 +44,9 @@ UButton::UButton(const FObjectInitializer& ObjectInitializer)
if (IsEditorWidget())
{
WidgetStyle = *EditorButtonStyle;
// The CDO isn't an editor widget and thus won't use the editor style, call post edit change to mark difference from CDO
PostEditChange();
}
#endif // WITH_EDITOR

View File

@@ -43,6 +43,9 @@ UCheckBox::UCheckBox(const FObjectInitializer& ObjectInitializer)
if (IsEditorWidget())
{
WidgetStyle = *EditorCheckboxStyle;
// The CDO isn't an editor widget and thus won't use the editor style, call post edit change to mark difference from CDO
PostEditChange();
}
#endif // WITH_EDITOR

View File

@@ -44,6 +44,9 @@ UCircularThrobber::UCircularThrobber(const FObjectInitializer& ObjectInitializer
if (IsEditorWidget())
{
Image = *EditorCircularThrobberBrushStyle;
// The CDO isn't an editor widget and thus won't use the editor style, call post edit change to mark difference from CDO
PostEditChange();
}
#endif // WITH_EDITOR

View File

@@ -22,6 +22,12 @@ UComboBoxKey::UComboBoxKey()
const ISlateStyle& SlateStyle = IsEditorWidget() ? FCoreStyle::Get() : FUMGCoreStyle::Get();
WidgetStyle = SlateStyle.GetWidgetStyle<FComboBoxStyle>("ComboBox");
ItemStyle = SlateStyle.GetWidgetStyle<FTableRowStyle>("TableView.Row");
if (IsEditorWidget())
{
// The CDO isn't an editor widget and thus won't use the editor style, call post edit change to mark difference from CDO
PostEditChange();
}
#else
WidgetStyle = FUMGCoreStyle::Get().GetWidgetStyle<FComboBoxStyle>("ComboBox");
ItemStyle = FUMGCoreStyle::Get().GetWidgetStyle<FTableRowStyle>("TableView.Row");

View File

@@ -63,6 +63,9 @@ UComboBoxString::UComboBoxString(const FObjectInitializer& ObjectInitializer)
{
WidgetStyle = *EditorComboBoxStyle;
ItemStyle = *EditorComboBoxRowStyle;
// The CDO isn't an editor widget and thus won't use the editor style, call post edit change to mark difference from CDO
PostEditChange();
}
#endif // WITH_EDITOR

View File

@@ -44,6 +44,9 @@ UEditableText::UEditableText(const FObjectInitializer& ObjectInitializer)
if (IsEditorWidget())
{
WidgetStyle = *EditorEditableTextStyle;
// The CDO isn't an editor widget and thus won't use the editor style, call post edit change to mark difference from CDO
PostEditChange();
}
#endif // WITH_EDITOR

View File

@@ -66,6 +66,9 @@ UEditableTextBox::UEditableTextBox(const FObjectInitializer& ObjectInitializer)
if (IsEditorWidget())
{
WidgetStyle = *EditorEditableTextBoxStyle;
// The CDO isn't an editor widget and thus won't use the editor style, call post edit change to mark difference from CDO
PostEditChange();
}
#endif // WITH_EDITOR

View File

@@ -69,6 +69,9 @@ UExpandableArea::UExpandableArea(const FObjectInitializer& ObjectInitializer)
{
Style = *EditorExpandableAreaStyle;
BorderBrush = *EditorExpandableAreaBorderBrush;
// The CDO isn't an editor widget and thus won't use the editor style, call post edit change to mark difference from CDO
PostEditChange();
}
#endif // WITH_EDITOR

View File

@@ -62,6 +62,9 @@ UInputKeySelector::UInputKeySelector( const FObjectInitializer& ObjectInitialize
{
WidgetStyle = *EditorInputKeySelectorButtonStyle;
TextStyle = *EditorInputKeySelectorTextStyle;
// The CDO isn't an editor widget and thus won't use the editor style, call post edit change to mark difference from CDO
PostEditChange();
}
#endif // WITH_EDITOR

View File

@@ -43,6 +43,9 @@ UMultiLineEditableText::UMultiLineEditableText(const FObjectInitializer& ObjectI
if (IsEditorWidget())
{
WidgetStyle = *EditorMultiLineEditableTextStyle;
// The CDO isn't an editor widget and thus won't use the editor style, call post edit change to mark difference from CDO
PostEditChange();
}
#endif // WITH_EDITOR

View File

@@ -67,6 +67,9 @@ UMultiLineEditableTextBox::UMultiLineEditableTextBox(const FObjectInitializer& O
{
WidgetStyle = *EditorMultiLineEditableTextBoxStyle;
TextStyle = *EditorMultiLineEditableTextBoxTextStyle;
// The CDO isn't an editor widget and thus won't use the editor style, call post edit change to mark difference from CDO
PostEditChange();
}
#endif // WITH_EDITOR

View File

@@ -40,6 +40,9 @@ UProgressBar::UProgressBar(const FObjectInitializer& ObjectInitializer)
if (IsEditorWidget())
{
WidgetStyle = *EditorProgressBarStyle;
// The CDO isn't an editor widget and thus won't use the editor style, call post edit change to mark difference from CDO
PostEditChange();
}
#endif // WITH_EDITOR

View File

@@ -48,6 +48,9 @@ UScrollBar::UScrollBar(const FObjectInitializer& ObjectInitializer)
if (IsEditorWidget())
{
WidgetStyle = *EditorScrollBarStyle;
// The CDO isn't an editor widget and thus won't use the editor style, call post edit change to mark difference from CDO
PostEditChange();
}
#endif // WITH_EDITOR
}

View File

@@ -80,6 +80,9 @@ UScrollBox::UScrollBox(const FObjectInitializer& ObjectInitializer)
{
WidgetStyle = *EditorScrollBoxStyle;
WidgetBarStyle = *EditorScrollBoxBarStyle;
// The CDO isn't an editor widget and thus won't use the editor style, call post edit change to mark difference from CDO
PostEditChange();
}
#endif // WITH_EDITOR

View File

@@ -52,6 +52,9 @@ USlider::USlider(const FObjectInitializer& ObjectInitializer)
if (IsEditorWidget())
{
WidgetStyle = *EditorSliderStyle;
// The CDO isn't an editor widget and thus won't use the editor style, call post edit change to mark difference from CDO
PostEditChange();
}
#endif // WITH_EDITOR

View File

@@ -61,6 +61,9 @@ USpinBox::USpinBox(const FObjectInitializer& ObjectInitializer)
if (IsEditorWidget())
{
WidgetStyle = *EditorSpinBoxStyle;
// The CDO isn't an editor widget and thus won't use the editor style, call post edit change to mark difference from CDO
PostEditChange();
}
#endif // WITH_EDITOR

View File

@@ -47,6 +47,9 @@ UThrobber::UThrobber(const FObjectInitializer& ObjectInitializer)
if (IsEditorWidget())
{
Image = *EditorThrobberBrush;
// The CDO isn't an editor widget and thus won't use the editor style, call post edit change to mark difference from CDO
PostEditChange();
}
#endif // WITH_EDITOR
}

View File

@@ -1089,6 +1089,10 @@ bool UWidget::IsEditorWidget() const
{
return WidgetBP->AllowEditorWidget();
}
else if (UUserWidget* UserWidget = Cast<UUserWidget>(WidgetBPObject))
{
return UserWidget->IsEditorUtility();
}
}
return false;

Some files were not shown because too many files have changed in this diff Show More