Stream Chat Unreal SDK
Loading...
Searching...
No Matches
UAttachmentWidget Class Reference

Displays a single attachment of a message. More...

#include <AttachmentWidget.h>

Public Member Functions

void Setup (const FAttachment &InAttachment, EMessageSide InSide)
 

Protected Attributes

UPanelWidget * ContentPanel
 Holds the attachment content. Generated in C++ when no widget blueprint provides one.
 
float ImageWidthFraction = 0.66f
 How much of the width an inline image may take. Its height then follows from its aspect ratio.
 
float MaxImageWidth = 320.f
 Ceiling on the above, so an image does not run away with a wide desktop window.
 
float MaxImageAspect = 2.f
 How many times its own width an image may be tall before it is fitted by height instead.
 
bool bRequestResizedImages = true
 Ask Stream's CDN for an image scaled to roughly the size it will be drawn at.
 
FMargin FileRowPadding = FMargin{12.f, 8.f}
 
int32 TitleFontSize = 14
 
int32 SubtitleFontSize = 12
 
FAttachment Attachment
 
EMessageSide Side = EMessageSide::You
 

Detailed Description

Displays a single attachment of a message.

Images are downloaded and shown inline. Everything else gets a row naming the file, because the SDK has no way of opening arbitrary content that would work on every platform it supports.

Unlike the other widgets here this one builds its own UMG tree in C++, so it needs no widget blueprint. Point UMessageWidget::AttachmentWidgetClass at your own class to replace it, or give a subclass a widget blueprint with a panel named ContentPanel and the content will be built into that instead of into a generated root.

Member Data Documentation

◆ bRequestResizedImages

bool UAttachmentWidget::bRequestResizedImages = true
protected

Ask Stream's CDN for an image scaled to roughly the size it will be drawn at.

A photo off a phone camera is around 25 megapixels, which is 93 MB once decoded, for something that ends up a couple of hundred points wide. Turn this off to always fetch the original.


The documentation for this class was generated from the following files: