void FSlateNotificationManager::FRegionalNotificationList::Arrange()
{
	FVector2D AnchorPoint(
		Region.Right - NotificationManagerConstants::NotificationOffset.X,
		Region.Bottom - NotificationManagerConstants::NotificationOffset.Y );

	for (int32 ListIndex = Notifications.Num() - 1; ListIndex >= 0; --ListIndex)
	{
		TSharedPtr<SWindow> PinnedWindow = Notifications[ListIndex]->ParentWindowPtr.Pin();
		if( PinnedWindow.IsValid() )
		{
			const FVector2D DesiredSize = PinnedWindow->GetDesiredSize();
			const FVector2D NewPosition(AnchorPoint.X - DesiredSize.X, AnchorPoint.Y - DesiredSize.Y);
			if( NewPosition != PinnedWindow->GetPositionInScreen() && DesiredSize != PinnedWindow->GetSizeInScreen() )
			{
				PinnedWindow->ReshapeWindow( NewPosition, DesiredSize );
			}
			else if( NewPosition != PinnedWindow->GetPositionInScreen() )
			{
				float StackOffset = NotificationManagerConstants::NotificationOffset.Y * ((Notifications.Num()-1) - ListIndex);
				PinnedWindow->MoveWindowTo(NewPosition - FVector2D(0, StackOffset));
			}
			AnchorPoint.Y -= DesiredSize.Y;
		}
	}
}
예제 #2
0
	//Construct an axis composed of a left/right or top/bottom pair of Attachments.
	//Either one of these Attachments is optional, and may be set to {} to use the component's
	// default width/height.
	//NOTE: forceSize only applies to "Centered" components
	Axis(const AnchorPoint& least, const AnchorPoint& greatest=AnchorPoint(), unsigned int forceSize=0) {
		isFullAxis = least.superSpecial;
		this->forceSize = forceSize;
		if (isFullAxis) {
			least_ = greatest;
			greatest_ = {};
		} else {
			least_ = least;
			greatest_ = greatest;
		}
	}