Files
UnrealEngineUWP/Engine/Source/Runtime/UMG/Private/Components/ListView.cpp

370 lines
8.7 KiB
C++
Raw Normal View History

// Copyright Epic Games, Inc. All Rights Reserved.
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "Components/ListView.h"
#include "Widgets/Views/SListView.h"
#include "Engine/World.h"
#include "TimerManager.h"
#include "Blueprint/ListViewDesignerPreviewItem.h"
#include "Styling/UMGCoreStyle.h"
#include "UMGPrivate.h"
#define LOCTEXT_NAMESPACE "UMG"
/////////////////////////////////////////////////////
// UListView
static FTableViewStyle* DefaultListViewStyle = nullptr;
static FScrollBarStyle* DefaultListViewScrollBarStyle = nullptr;
#if WITH_EDITOR
static FTableViewStyle* EditorListViewStyle = nullptr;
static FScrollBarStyle* EditorListViewScrollBarStyle = nullptr;
#endif
UListView::UListView(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
, Orientation(EOrientation::Orient_Vertical)
{
if (DefaultListViewStyle == nullptr)
{
DefaultListViewStyle = new FTableViewStyle(FUMGCoreStyle::Get().GetWidgetStyle<FTableViewStyle>("ListView"));
// Unlink UMG default colors.
DefaultListViewStyle->UnlinkColors();
}
if (DefaultListViewScrollBarStyle == nullptr)
{
DefaultListViewScrollBarStyle = new FScrollBarStyle(FUMGCoreStyle::Get().GetWidgetStyle<FScrollBarStyle>("Scrollbar"));
// Unlink UMG default colors.
DefaultListViewScrollBarStyle->UnlinkColors();
}
WidgetStyle = *DefaultListViewStyle;
ScrollBarStyle = *DefaultListViewScrollBarStyle;
#if WITH_EDITOR
if (EditorListViewStyle == nullptr)
{
EditorListViewStyle = new FTableViewStyle(FAppStyle::Get().GetWidgetStyle<FTableViewStyle>("ListView"));
// Unlink UMG default colors.
EditorListViewStyle->UnlinkColors();
}
if (EditorListViewScrollBarStyle == nullptr)
{
EditorListViewScrollBarStyle = new FScrollBarStyle(FCoreStyle::Get().GetWidgetStyle<FScrollBarStyle>("Scrollbar"));
// Unlink UMG default colors.
EditorListViewScrollBarStyle->UnlinkColors();
}
if (IsEditorWidget())
{
WidgetStyle = *EditorListViewStyle;
ScrollBarStyle = *EditorListViewScrollBarStyle;
}
#endif // WITH_EDITOR
}
Copying //UE4/Dev-Sequencer to Dev-Main (//UE4/Dev-Main) #lockdown nick.penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2719576 on 2015/10/07 by Chris.Wood Added check for stale BP classes in FKismetCompilerUtilities::IsTypeCompatibleWithProperty() to stop compiler errors during reinstancing. [UE-19795] - UMG Compiler error when adding variable to nested Widget Change 2721474 on 2015/10/08 by Andrew.Rodham Sequencer: Movie render operations now successfully capture UMG UI Change 2724958 on 2015/10/12 by Chris.Wood Added missing resource cleanup code to UMG widgets [UE-21874] - UWIdget classes with missing ReleaseSlateResources() overrides Added ReleaseSlateResources() to ListView, TileView and Slider widgets to reset shared pointers to slate widgets. Change 2733562 on 2015/10/19 by Andrew.Rodham Sequencer: Fixed spawnables not working in sub-sequences - The issue here was that sequence track instance updates had no knowledge of which sub-sequence they were being evaluated within. We now pass the active sequence instance into the relevant track instance functions. - Also addressed some issues to do with save/restore state not getting called correctly on master tracks of sequence instances - Tidied up spawn track editor Change 2735264 on 2015/10/20 by Chris.Wood Improved Engine analytics handling for Editor and games [UE-21892] - Improve how Engine analytics are handled for Editor and games Changes: Added Privacy section to Editor settings Exposed editor analytics flag in Privacy options Added Details Customization to make this type of bool property clearer with extra info and hyperlink Changed AreEditorAnalyticsEnable() to use new flag Prevented analytics init when disabled by user Sending event and shutting down analytics when user opts out Add in-game project setting for anonymous game usage data Renamed and moved bHardwareSurveyEnabled Added message about exposing in-game setting to end users Added anonymous GUID id for in-game analytics Moved end user settings to global config (defaultengine.ini) Placeholder loc text on new options for now, pending legal wording sign-off Change 2735866 on 2015/10/20 by Max.Preussner Async: Added ability to register an optional callback function that is executed when a Future completes Change 2739793 on 2015/10/23 by Andrew.Rodham Sequencer: Refined movie scene capturing to ensure frame accuracies are maintained - Aborting an in-progress capture now gracefully terminates the process (through a remote session command) to ensure it still creates a valid video - Level sequece movie capture will now pick up a corresponding level sequence in the world, and use that to capture with. A new actor will be spawned at runtime with the correct asset, should one not already exist. - Made -nomovie actually work - Refined how active movie captures are managed - Added option to 'stage' a sequence before starting the capture. This feature will set the sequence on its first frame for the preroll, to ensure that PPP effects are allowed time to stabilize Change 2744402 on 2015/10/28 by Max.Preussner Sequencer: Separated track display names from track identifier names; code cleanup Change 2745953 on 2015/10/29 by Max.Chen Sequencer: Attach to socket. Relative attachments. #jira UETOOL-463 Change 2747028 on 2015/10/29 by Max.Preussner Sequencer: Another overhaul of track display name handling; code and documentation cleanup pass. Change 2758888 on 2015/11/09 by Chris.Wood Integrating changes - 4.10 to Dev-Sequencer From 4.10 branch fixes: Added check for debugger present when reporting abnormal termination to analytics. [UE-22844] CL 2750764 Added FSystemWideCriticalSection for desktop platforms. Used by analytics to lock access to editor instances list in the OS. [UE-22844] CL 2753661 Updating wording in privacy settings text. [UE-21892] CL 2753709 Mac and Linux CIS fix [UE-22844] CL 2755381 Change 2761287 on 2015/11/10 by Max.Chen Sequencer: Add null check when updating the UMG preview if the sequencer doesn't exist/has been closed. #jira UE-5206 Change 2764945 on 2015/11/12 by Max.Preussner Core: Templatized TypeContainer implementation to allow for thread-safe objects; updated unit test Also fixes UE-13850 Change 2765036 on 2015/11/12 by Max.Preussner UdpMessaging: Fixed message serialization unit test (UE-22571) #jira: UE-22571 Change 2766149 on 2015/11/13 by Max.Preussner Media: Implemented event that gets triggered when playback reached the end of media Also fixes looping. Change 2768157 on 2015/11/16 by Max.Preussner Media: Added .m4a to supported WMF file extensions Change 2769200 on 2015/11/16 by Max.Chen Editor: Add broadcast messages when snapping objects. #jira UE-22680 Change 2773066 on 2015/11/19 by Chris.Wood Upload crashes from CRC to Data Router [UECORE-249] - Integrate Crash Report Client with the Data Router Upload to Receiver still active as we are running both in parallel for now.
2015-12-11 13:52:32 -05:00
void UListView::ReleaseSlateResources(bool bReleaseChildren)
{
Super::ReleaseSlateResources(bReleaseChildren);
MyListView.Reset();
}
#if WITH_EDITOR
void UListView::OnRefreshDesignerItems()
{
RefreshDesignerItems<UObject*>(ListItems, [this] () {return NewObject<UListViewDesignerPreviewItem>(this); });
}
#endif
void UListView::AddItem(UObject* Item)
{
if (Item == nullptr)
{
FFrame::KismetExecutionMessage(TEXT("Cannot add null item into ListView."), ELogVerbosity::Warning, "NullListViewItem");
return;
}
if (ListItems.Contains(Item))
{
FFrame::KismetExecutionMessage(TEXT("Cannot add duplicate item into ListView."), ELogVerbosity::Warning, "DuplicateListViewItem");
return;
}
ListItems.Add(Item);
const TArray<UObject*> Added = { Item };
const TArray<UObject*> Removed;
OnItemsChanged(Added, Removed);
RequestRefresh();
}
void UListView::RemoveItem(UObject* Item)
{
ListItems.Remove(Item);
const TArray<UObject*> Added;
const TArray<UObject*> Removed = { Item };
OnItemsChanged(Added, Removed);
RequestRefresh();
}
UObject* UListView::GetItemAt(int32 Index) const
{
return ListItems.IsValidIndex(Index) ? ListItems[Index] : nullptr;
}
int32 UListView::GetNumItems() const
{
return ListItems.Num();
}
int32 UListView::GetIndexForItem(const UObject* Item) const
{
return ListItems.IndexOfByKey(Item);
}
void UListView::ClearListItems()
{
const TArray<UObject*> Added;
const TArray<UObject*> Removed = MoveTemp(ListItems);
ListItems.Reset();
OnItemsChanged(Added, Removed);
RequestRefresh();
}
void UListView::SetSelectionMode(TEnumAsByte<ESelectionMode::Type> InSelectionMode)
{
[UE-73025] - Fixing UserListEntry interface structure screwup, inheriting directly from IUserListEntry in a BP will no longer crash - Removed INativeUserListEntry and moved the functionality into native functions on IUserListEntry and a static BP library - UUserListEntry is now marked as a BlueprintType, so it'll appear as a Cast option in BP (gotta disable "context sensitive" in the context menu) Fixed unnecessary requirement that IUserObjectListEntry children cache and return their assigned list item in GetListItemObject() - The existing design of SListView has the list tracking the entry-item association and the entries accessing their item via the owning list, so the UMG version now follows suit - GetListItemObject is now a static BP method, the previously existing GetListItem<T>() remains as before - Renamed SetListItemObjectInternal to NativeOnListItemObjectSet, as it isn't required to function as a literal setter anymore, so we can keep to the naming scheme used elsewhere in UMG for this scenario Fixing half-implemented option to change selection mode of a UListView - Now properly forwards the setting to the SListView to affect future selection behavior Note: Redirects are set up for the functions that became static BP functions and work in situ for cases where they were being called on "self". Cases where an external object called these methods on another objects will point to the new function, but will require manual node fixup #rb Nick.Darnell [at]Vincent.Gauthier, [at]Dave.Belanger #jira UE-73025 #ROBOMERGE-SOURCE: CL 6585521 via CL 6590540 via CL 6592493 #ROBOMERGE-BOT: (v351-6581450) [CL 6592608 by dan hertzka in Main branch]
2019-05-20 20:44:17 -04:00
SelectionMode = InSelectionMode;
if (MyListView)
{
[UE-73025] - Fixing UserListEntry interface structure screwup, inheriting directly from IUserListEntry in a BP will no longer crash - Removed INativeUserListEntry and moved the functionality into native functions on IUserListEntry and a static BP library - UUserListEntry is now marked as a BlueprintType, so it'll appear as a Cast option in BP (gotta disable "context sensitive" in the context menu) Fixed unnecessary requirement that IUserObjectListEntry children cache and return their assigned list item in GetListItemObject() - The existing design of SListView has the list tracking the entry-item association and the entries accessing their item via the owning list, so the UMG version now follows suit - GetListItemObject is now a static BP method, the previously existing GetListItem<T>() remains as before - Renamed SetListItemObjectInternal to NativeOnListItemObjectSet, as it isn't required to function as a literal setter anymore, so we can keep to the naming scheme used elsewhere in UMG for this scenario Fixing half-implemented option to change selection mode of a UListView - Now properly forwards the setting to the SListView to affect future selection behavior Note: Redirects are set up for the functions that became static BP functions and work in situ for cases where they were being called on "self". Cases where an external object called these methods on another objects will point to the new function, but will require manual node fixup #rb Nick.Darnell [at]Vincent.Gauthier, [at]Dave.Belanger #jira UE-73025 #ROBOMERGE-SOURCE: CL 6585521 via CL 6590540 via CL 6592493 #ROBOMERGE-BOT: (v351-6581450) [CL 6592608 by dan hertzka in Main branch]
2019-05-20 20:44:17 -04:00
MyListView->SetSelectionMode(InSelectionMode);
}
}
int32 UListView::BP_GetNumItemsSelected() const
{
return GetNumItemsSelected();
}
void UListView::BP_SetListItems(const TArray<UObject*>& InListItems)
{
SetListItems(InListItems);
}
UObject* UListView::BP_GetSelectedItem() const
{
return GetSelectedItem();
}
void UListView::HandleOnEntryInitializedInternal(UObject* Item, const TSharedRef<ITableRow>& TableRow)
{
BP_OnEntryInitialized.Broadcast(Item, GetEntryWidgetFromItem(Item));
}
bool UListView::BP_GetSelectedItems(TArray<UObject*>& Items) const
{
return GetSelectedItems(Items) > 0;
}
bool UListView::BP_IsItemVisible(UObject* Item) const
{
return IsItemVisible(Item);
}
void UListView::BP_NavigateToItem(UObject* Item)
{
if (Item)
{
RequestNavigateToItem(Item);
}
}
void UListView::NavigateToIndex(int32 Index)
{
RequestNavigateToItem(GetItemAt(Index));
}
void UListView::BP_ScrollItemIntoView(UObject* Item)
{
if (Item)
{
RequestScrollItemIntoView(Item);
}
}
void UListView::ScrollIndexIntoView(int32 Index)
{
BP_ScrollItemIntoView(GetItemAt(Index));
}
void UListView::BP_CancelScrollIntoView()
{
if (MyListView.IsValid())
{
MyListView->CancelScrollIntoView();
}
}
bool UListView::IsRefreshPending() const
{
if (MyListView.IsValid())
{
return MyListView->IsPendingRefresh();
}
return false;
}
void UListView::BP_SetSelectedItem(UObject* Item)
{
if (MyListView.IsValid())
{
MyListView->SetSelection(Item, ESelectInfo::Direct);
}
}
void UListView::SetSelectedItem(const UObject* Item)
{
ITypedUMGListView<UObject*>::SetSelectedItem(const_cast<UObject*>(Item));
}
void UListView::SetSelectedIndex(int32 Index)
{
SetSelectedItem(GetItemAt(Index));
}
void UListView::BP_SetItemSelection(UObject* Item, bool bSelected)
{
SetItemSelection(Item, bSelected);
}
void UListView::BP_ClearSelection()
{
ClearSelection();
}
void UListView::OnItemsChanged(const TArray<UObject*>& AddedItems, const TArray<UObject*>& RemovedItems)
{
// Allow subclasses to do special things when objects are added or removed from the list.
// Keep track of references to Actors and make sure to release them when Actors are about to be removed
for (UObject* AddedItem : AddedItems)
{
if (AActor* AddedActor = Cast<AActor>(AddedItem))
{
AddedActor->OnEndPlay.AddDynamic(this, &UListView::OnListItemEndPlayed);
}
else if (AActor* AddedItemOuterActor = AddedItem->GetTypedOuter<AActor>())
{
// Unique so that we don't spam events for shared actor outers but this also means we can't
// unsubscribe when processing RemovedItems
AddedItemOuterActor->OnEndPlay.AddUniqueDynamic(this, &UListView::OnListItemOuterEndPlayed);
}
}
for (UObject* RemovedItem : RemovedItems)
{
if (AActor* RemovedActor = Cast<AActor>(RemovedItem))
{
RemovedActor->OnEndPlay.RemoveDynamic(this, &UListView::OnListItemEndPlayed);
}
}
}
void UListView::OnListItemEndPlayed(AActor* Item, EEndPlayReason::Type EndPlayReason)
{
RemoveItem(Item);
}
void UListView::OnListItemOuterEndPlayed(AActor* ItemOuter, EEndPlayReason::Type EndPlayReason)
{
for (int32 ItemIndex = ListItems.Num() - 1; ItemIndex >= 0; --ItemIndex)
{
UObject* Item = ListItems[ItemIndex];
if (Item->IsIn(ItemOuter))
{
RemoveItem(Item);
}
}
}
TSharedRef<STableViewBase> UListView::RebuildListWidget()
{
return ConstructListView<SListView>();
}
void UListView::HandleListEntryHovered(UUserWidget& EntryWidget)
{
[UE-73025] - Fixing UserListEntry interface structure screwup, inheriting directly from IUserListEntry in a BP will no longer crash - Removed INativeUserListEntry and moved the functionality into native functions on IUserListEntry and a static BP library - UUserListEntry is now marked as a BlueprintType, so it'll appear as a Cast option in BP (gotta disable "context sensitive" in the context menu) Fixed unnecessary requirement that IUserObjectListEntry children cache and return their assigned list item in GetListItemObject() - The existing design of SListView has the list tracking the entry-item association and the entries accessing their item via the owning list, so the UMG version now follows suit - GetListItemObject is now a static BP method, the previously existing GetListItem<T>() remains as before - Renamed SetListItemObjectInternal to NativeOnListItemObjectSet, as it isn't required to function as a literal setter anymore, so we can keep to the naming scheme used elsewhere in UMG for this scenario Fixing half-implemented option to change selection mode of a UListView - Now properly forwards the setting to the SListView to affect future selection behavior Note: Redirects are set up for the functions that became static BP functions and work in situ for cases where they were being called on "self". Cases where an external object called these methods on another objects will point to the new function, but will require manual node fixup #rb Nick.Darnell [at]Vincent.Gauthier, [at]Dave.Belanger #jira UE-73025 #ROBOMERGE-SOURCE: CL 6585521 via CL 6590540 via CL 6592493 #ROBOMERGE-BOT: (v351-6581450) [CL 6592608 by dan hertzka in Main branch]
2019-05-20 20:44:17 -04:00
if (UObject* const* ListItem = ItemFromEntryWidget(EntryWidget))
{
[UE-73025] - Fixing UserListEntry interface structure screwup, inheriting directly from IUserListEntry in a BP will no longer crash - Removed INativeUserListEntry and moved the functionality into native functions on IUserListEntry and a static BP library - UUserListEntry is now marked as a BlueprintType, so it'll appear as a Cast option in BP (gotta disable "context sensitive" in the context menu) Fixed unnecessary requirement that IUserObjectListEntry children cache and return their assigned list item in GetListItemObject() - The existing design of SListView has the list tracking the entry-item association and the entries accessing their item via the owning list, so the UMG version now follows suit - GetListItemObject is now a static BP method, the previously existing GetListItem<T>() remains as before - Renamed SetListItemObjectInternal to NativeOnListItemObjectSet, as it isn't required to function as a literal setter anymore, so we can keep to the naming scheme used elsewhere in UMG for this scenario Fixing half-implemented option to change selection mode of a UListView - Now properly forwards the setting to the SListView to affect future selection behavior Note: Redirects are set up for the functions that became static BP functions and work in situ for cases where they were being called on "self". Cases where an external object called these methods on another objects will point to the new function, but will require manual node fixup #rb Nick.Darnell [at]Vincent.Gauthier, [at]Dave.Belanger #jira UE-73025 #ROBOMERGE-SOURCE: CL 6585521 via CL 6590540 via CL 6592493 #ROBOMERGE-BOT: (v351-6581450) [CL 6592608 by dan hertzka in Main branch]
2019-05-20 20:44:17 -04:00
OnItemIsHoveredChanged().Broadcast(*ListItem, true);
BP_OnItemIsHoveredChanged.Broadcast(*ListItem, true);
}
}
void UListView::HandleListEntryUnhovered(UUserWidget& EntryWidget)
{
[UE-73025] - Fixing UserListEntry interface structure screwup, inheriting directly from IUserListEntry in a BP will no longer crash - Removed INativeUserListEntry and moved the functionality into native functions on IUserListEntry and a static BP library - UUserListEntry is now marked as a BlueprintType, so it'll appear as a Cast option in BP (gotta disable "context sensitive" in the context menu) Fixed unnecessary requirement that IUserObjectListEntry children cache and return their assigned list item in GetListItemObject() - The existing design of SListView has the list tracking the entry-item association and the entries accessing their item via the owning list, so the UMG version now follows suit - GetListItemObject is now a static BP method, the previously existing GetListItem<T>() remains as before - Renamed SetListItemObjectInternal to NativeOnListItemObjectSet, as it isn't required to function as a literal setter anymore, so we can keep to the naming scheme used elsewhere in UMG for this scenario Fixing half-implemented option to change selection mode of a UListView - Now properly forwards the setting to the SListView to affect future selection behavior Note: Redirects are set up for the functions that became static BP functions and work in situ for cases where they were being called on "self". Cases where an external object called these methods on another objects will point to the new function, but will require manual node fixup #rb Nick.Darnell [at]Vincent.Gauthier, [at]Dave.Belanger #jira UE-73025 #ROBOMERGE-SOURCE: CL 6585521 via CL 6590540 via CL 6592493 #ROBOMERGE-BOT: (v351-6581450) [CL 6592608 by dan hertzka in Main branch]
2019-05-20 20:44:17 -04:00
if (UObject* const* ListItem = ItemFromEntryWidget(EntryWidget))
{
[UE-73025] - Fixing UserListEntry interface structure screwup, inheriting directly from IUserListEntry in a BP will no longer crash - Removed INativeUserListEntry and moved the functionality into native functions on IUserListEntry and a static BP library - UUserListEntry is now marked as a BlueprintType, so it'll appear as a Cast option in BP (gotta disable "context sensitive" in the context menu) Fixed unnecessary requirement that IUserObjectListEntry children cache and return their assigned list item in GetListItemObject() - The existing design of SListView has the list tracking the entry-item association and the entries accessing their item via the owning list, so the UMG version now follows suit - GetListItemObject is now a static BP method, the previously existing GetListItem<T>() remains as before - Renamed SetListItemObjectInternal to NativeOnListItemObjectSet, as it isn't required to function as a literal setter anymore, so we can keep to the naming scheme used elsewhere in UMG for this scenario Fixing half-implemented option to change selection mode of a UListView - Now properly forwards the setting to the SListView to affect future selection behavior Note: Redirects are set up for the functions that became static BP functions and work in situ for cases where they were being called on "self". Cases where an external object called these methods on another objects will point to the new function, but will require manual node fixup #rb Nick.Darnell [at]Vincent.Gauthier, [at]Dave.Belanger #jira UE-73025 #ROBOMERGE-SOURCE: CL 6585521 via CL 6590540 via CL 6592493 #ROBOMERGE-BOT: (v351-6581450) [CL 6592608 by dan hertzka in Main branch]
2019-05-20 20:44:17 -04:00
OnItemIsHoveredChanged().Broadcast(*ListItem, false);
BP_OnItemIsHoveredChanged.Broadcast(*ListItem, false);
}
}
FMargin UListView::GetDesiredEntryPadding(UObject* Item) const
{
if (ListItems.Num() > 0 && ListItems[0] != Item)
{
if (Orientation == EOrientation::Orient_Horizontal)
{
// For all entries after the first one, add the spacing as left padding
return FMargin(EntrySpacing, 0.f, 0.0f, 0.f);
}
else
{
// For all entries after the first one, add the spacing as top padding
return FMargin(0.f, EntrySpacing, 0.f, 0.f);
}
}
return FMargin(0.f);
}
UUserWidget& UListView::OnGenerateEntryWidgetInternal(UObject* Item, TSubclassOf<UUserWidget> DesiredEntryClass, const TSharedRef<STableViewBase>& OwnerTable)
{
return GenerateTypedEntry(DesiredEntryClass, OwnerTable);
}
void UListView::OnItemClickedInternal(UObject* ListItem)
{
BP_OnItemClicked.Broadcast(ListItem);
}
void UListView::OnItemDoubleClickedInternal(UObject* ListItem)
{
BP_OnItemDoubleClicked.Broadcast(ListItem);
}
void UListView::OnSelectionChangedInternal(UObject* FirstSelectedItem)
{
BP_OnItemSelectionChanged.Broadcast(FirstSelectedItem, FirstSelectedItem != nullptr);
}
void UListView::OnItemScrolledIntoViewInternal(UObject* ListItem, UUserWidget& EntryWidget)
{
BP_OnItemScrolledIntoView.Broadcast(ListItem, &EntryWidget);
}
/////////////////////////////////////////////////////
#undef LOCTEXT_NAMESPACE