mirror of
https://github.com/sinbad/StevesUEHelpers.git
synced 2025-02-23 17:45:23 +00:00
5.0 compat
This commit is contained in:
parent
cc6eea4862
commit
cb8a830d54
@ -6,11 +6,18 @@ TSharedRef<SWidget> UFocusableCheckBox::RebuildWidget()
|
||||
{
|
||||
MyCheckbox = SNew(SFocusableCheckBox)
|
||||
.OnCheckStateChanged( BIND_UOBJECT_DELEGATE(FOnCheckStateChanged, SlateOnCheckStateChangedCallback) )
|
||||
#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION > 0
|
||||
.Style(&GetWidgetStyle())
|
||||
.HAlign( HorizontalAlignment )
|
||||
.ClickMethod(GetClickMethod())
|
||||
.TouchMethod(GetTouchMethod())
|
||||
.PressMethod(GetPressMethod())
|
||||
#else
|
||||
.Style(&WidgetStyle)
|
||||
.ClickMethod(ClickMethod)
|
||||
.TouchMethod(TouchMethod)
|
||||
.PressMethod(PressMethod)
|
||||
#endif
|
||||
.HAlign( HorizontalAlignment )
|
||||
.IsFocusable(IsFocusable)
|
||||
// Our new events
|
||||
.OnHovered(BIND_UOBJECT_DELEGATE(FSimpleDelegate, SlateHandleHovered))
|
||||
@ -34,7 +41,11 @@ TSharedRef<SWidget> UFocusableCheckBox::RebuildWidget()
|
||||
void UFocusableCheckBox::RefreshFocussedStyle_Implementation()
|
||||
{
|
||||
// Copy Widget style but make normal same as hovered
|
||||
#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION > 0
|
||||
FocussedStyle = GetWidgetStyle();
|
||||
#else
|
||||
FocussedStyle = WidgetStyle;
|
||||
#endif
|
||||
FocussedStyle.UncheckedImage = FocussedStyle.UncheckedHoveredImage;
|
||||
FocussedStyle.CheckedImage = FocussedStyle.CheckedHoveredImage;
|
||||
FocussedStyle.UndeterminedImage = FocussedStyle.UndeterminedHoveredImage;
|
||||
@ -65,7 +76,11 @@ void UFocusableCheckBox::UndoFocusStyle()
|
||||
{
|
||||
if (MyCheckbox.IsValid())
|
||||
{
|
||||
#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION > 0
|
||||
MyCheckbox->SetStyle(&GetWidgetStyle());
|
||||
#else
|
||||
MyCheckbox->SetStyle(&WidgetStyle);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user