本文整理汇总了C++中FMargin函数的典型用法代码示例。如果您正苦于以下问题:C++ FMargin函数的具体用法?C++ FMargin怎么用?C++ FMargin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FMargin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SNew
void SAnimMontageSectionsPanel::Construct(const FArguments& InArgs)
{
MontageEditor = InArgs._MontageEditor;
Montage = InArgs._Montage;
SelectedCompositeSection = INDEX_NONE;
this->ChildSlot
[
SNew(SVerticalBox)
+SVerticalBox::Slot()
.FillHeight(1)
[
SNew( SExpandableArea )
.AreaTitle( LOCTEXT("Sections", "Sections") )
.BodyContent()
[
SNew( SBorder )
.Padding( FMargin(2.f, 2.f) )
[
SAssignNew( PanelArea, SBorder )
.BorderImage( FEditorStyle::GetBrush("NoBorder") )
.Padding( FMargin(2.0f, 2.0f) )
.ColorAndOpacity( FLinearColor::White )
]
]
]
];
Update();
}
示例2: FSlateLayoutTransform
int32 FCinematicShotSection::OnPaintSection(FSequencerSectionPainter& InPainter) const
{
static const FSlateBrush* FilmBorder = FEditorStyle::GetBrush("Sequencer.Section.FilmBorder");
InPainter.LayerId = InPainter.PaintSectionBackground();
FVector2D SectionSize = InPainter.SectionGeometry.GetLocalSize();
FSlateDrawElement::MakeBox(
InPainter.DrawElements,
InPainter.LayerId++,
InPainter.SectionGeometry.ToPaintGeometry(FVector2D(SectionSize.X-2.f, 7.f), FSlateLayoutTransform(FVector2D(1.f, 4.f))),
FilmBorder,
InPainter.SectionClippingRect.InsetBy(FMargin(1.f)),
InPainter.bParentEnabled ? ESlateDrawEffect::None : ESlateDrawEffect::DisabledEffect
);
FSlateDrawElement::MakeBox(
InPainter.DrawElements,
InPainter.LayerId++,
InPainter.SectionGeometry.ToPaintGeometry(FVector2D(SectionSize.X-2.f, 7.f), FSlateLayoutTransform(FVector2D(1.f, SectionSize.Y - 11.f))),
FilmBorder,
InPainter.SectionClippingRect.InsetBy(FMargin(1.f)),
InPainter.bParentEnabled ? ESlateDrawEffect::None : ESlateDrawEffect::DisabledEffect
);
if (SequenceInstance.IsValid())
{
return FThumbnailSection::OnPaintSection(InPainter);
}
return InPainter.LayerId;
}
示例3: SNew
void SErrorUI::Construct(const FArguments& args)
{
MenuHUD = args._MenuHUD;
const FMenuBackgroundStyle* BackgroundStyle = &FMagicBattleSoccerStyles::Get().GetWidgetStyle<FMenuBackgroundStyle>("DefaultMenuBackgroundStyle");
const FButtonStyle* ButtonStyle = &FMagicBattleSoccerStyles::Get().GetWidgetStyle<FButtonStyle>("DefaultMenuButtonStyle");
UMagicBattleSoccerEngine *Engine = (UMagicBattleSoccerEngine*)GEngine;
ChildSlot
[
// Overlay level
SNew(SOverlay)
+ SOverlay::Slot()
.HAlign(HAlign_Center)
.VAlign(VAlign_Center)
[
// Border level (fills overlay with background image)
SNew(SBorder)
.BorderImage(&BackgroundStyle->BackgroundBrush)
[
// Vertical margins (space between menu items and border) level
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.Padding(FMargin(0,15,0,15))
[
// Horizontal margins (space between menu items and border) level
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.Padding(FMargin(0, 15, 0, 15))
.MaxWidth(800)
[
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.Padding(10.0f)
.MaxHeight(600)
[
SNew(STextBlock)
.TextStyle(FMagicBattleSoccerStyles::Get(), "MagicBattleSoccer.ButtonTextStyle")
.Text(this, &SErrorUI::GetLastErrorString)
.WrapTextAt(770)
]
+ SVerticalBox::Slot()
.Padding(10.0f)
[
// OK button
SNew(SButton)
.HAlign(HAlign_Center)
.VAlign(VAlign_Center)
.ButtonStyle(ButtonStyle)
.ContentPadding(FMargin(80.0, 2.0))
.TextStyle(FMagicBattleSoccerStyles::Get(), "MagicBattleSoccer.ButtonTextStyle")
.Text(FText::FromString("OK"))
.OnClicked(this, &SErrorUI::OnOK)
]
]
]
]
]
];
}
示例4: SNew
TSharedRef<ITableRow> SVisualLoggerLogsList::LogEntryLinesGenerateRow(TSharedPtr<FLogEntryItem> Item, const TSharedRef<STableViewBase>& OwnerTable)
{
return SNew(STableRow< TSharedPtr<FString> >, OwnerTable)
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.AutoWidth()
.Padding(FMargin(5.0f, 0.0f))
[
SNew(STextBlock)
.ColorAndOpacity(FSlateColor(Item->CategoryColor))
.Text( FText::FromString(Item->Category) )
.HighlightText(this, &SVisualLoggerLogsList::GetFilterText)
]
+ SHorizontalBox::Slot()
.AutoWidth()
.Padding(FMargin(5.0f, 0.0f))
[
SNew(STextBlock)
.ColorAndOpacity(FSlateColor(Item->Verbosity == ELogVerbosity::Error ? FLinearColor::Red : (Item->Verbosity == ELogVerbosity::Warning ? FLinearColor::Yellow : FLinearColor::Gray)))
.Text(FText::FromString(FString(TEXT("(")) + FString(FOutputDevice::VerbosityToString(Item->Verbosity)) + FString(TEXT(")"))))
]
+ SHorizontalBox::Slot()
.Padding(FMargin(5.0f, 0.0f))
[
SNew(STextBlock)
.AutoWrapText(true)
.ColorAndOpacity(FSlateColor(Item->Verbosity == ELogVerbosity::Error ? FLinearColor::Red : (Item->Verbosity == ELogVerbosity::Warning ? FLinearColor::Yellow : FLinearColor::Gray)))
.Text(FText::FromString(Item->Line))
.HighlightText(this, &SVisualLoggerLogsList::GetFilterText)
]
];
}
示例5: Construct
void Construct(const FArguments& InArgs,
TSharedPtr<IPropertyHandle> AnchorsHandle,
TSharedPtr<IPropertyHandle> AlignmentHandle,
TSharedPtr<IPropertyHandle> OffsetsHandle,
FText LabelText,
FAnchors Anchors)
{
ResizeCurve = FCurveSequence(0, 0.40f);
ChildSlot
[
SNew(SButton)
.ButtonStyle(FEditorStyle::Get(), "SimpleSharpButton")
.ButtonColorAndOpacity(FLinearColor(FColor(40, 40, 40)))
.OnClicked(this, &SAnchorPreviewWidget::OnAnchorClicked, AnchorsHandle, AlignmentHandle, OffsetsHandle, Anchors)
.ContentPadding(FMargin(2.0f, 2.0f))
[
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.AutoHeight()
[
SNew(SBorder)
.BorderImage(FEditorStyle::GetBrush("UMGEditor.AnchorGrid"))
.Padding(0)
[
SNew(SBox)
.WidthOverride(64)
.HeightOverride(64)
.HAlign(HAlign_Center)
.VAlign(VAlign_Center)
[
SNew(SBox)
.WidthOverride(this, &SAnchorPreviewWidget::GetCurrentWidth)
.HeightOverride(this, &SAnchorPreviewWidget::GetCurrentHeight)
[
SNew(SBorder)
//.BorderImage(FEditorStyle::GetBrush("NoBrush"))
//.BorderImage(FEditorStyle::GetBrush("ToolPanel.GroupBorder"))
//.BorderBackgroundColor
.Padding(1)
[
SNew(SConstraintCanvas)
+ SConstraintCanvas::Slot()
.Anchors(Anchors)
.Offset(FMargin(0, 0, Anchors.IsStretchedHorizontal() ? 0 : 15, Anchors.IsStretchedVertical() ? 0 : 15))
.Alignment(FVector2D(Anchors.IsStretchedHorizontal() ? 0 : Anchors.Minimum.X, Anchors.IsStretchedVertical() ? 0 : Anchors.Minimum.Y))
[
SNew(SImage)
.Image(FEditorStyle::Get().GetBrush("UMGEditor.AnchoredWidget"))
]
]
]
]
]
]
]
];
}
示例6: check
TSharedRef<SDockTab> FPropertyEditorToolkit::SpawnTab_PropertyTable( const FSpawnTabArgs& Args )
{
check( Args.GetTabId() == GridTabId );
FPropertyEditorModule& PropertyEditorModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>( "PropertyEditor" );
TSharedRef<SDockTab> GridToolkitTab = SNew(SDockTab)
.Icon( FEditorStyle::GetBrush("PropertyEditor.Grid.TabIcon") )
.Label( LOCTEXT("GenericGridTitle", "Grid") )
.TabColorScale( GetTabColorScale() )
.Content()
[
SNew( SOverlay )
+SOverlay::Slot()
[
PropertyEditorModule.CreatePropertyTableWidget( PropertyTable.ToSharedRef() )
]
+SOverlay::Slot()
.HAlign( HAlign_Right )
.VAlign( VAlign_Top )
.Padding( FMargin( 0, 3, 0, 0 ) )
[
SNew( SHorizontalBox )
+SHorizontalBox::Slot()
.AutoWidth()
.HAlign( HAlign_Center )
.VAlign( VAlign_Center )
[
SNew( SImage )
.Image( FEditorStyle::GetBrush( "PropertyEditor.AddColumnOverlay" ) )
.Visibility( this, &FPropertyEditorToolkit::GetAddColumnInstructionsOverlayVisibility )
]
+SHorizontalBox::Slot()
.AutoWidth()
.HAlign( HAlign_Center )
.VAlign( VAlign_Center )
[
SNew( SImage )
.Image( FEditorStyle::GetBrush( "PropertyEditor.RemoveColumn" ) )
.Visibility( this, &FPropertyEditorToolkit::GetAddColumnInstructionsOverlayVisibility )
]
+SHorizontalBox::Slot()
.AutoWidth()
.HAlign( HAlign_Center )
.VAlign( VAlign_Center )
.Padding( FMargin( 0, 0, 3, 0 ) )
[
SNew( STextBlock )
.Font( FEditorStyle::GetFontStyle( "PropertyEditor.AddColumnMessage.Font" ) )
.Text( LOCTEXT("GenericPropertiesTitle", "Pin Properties to Add Columns") )
.Visibility( this, &FPropertyEditorToolkit::GetAddColumnInstructionsOverlayVisibility )
.ColorAndOpacity( FEditorStyle::GetColor( "PropertyEditor.AddColumnMessage.ColorAndOpacity" ) )
]
]
];
return GridToolkitTab;
}
示例7: OnFiltersChanged
void STimeline::Construct(const FArguments& InArgs, TSharedPtr<SVisualLoggerView> VisualLoggerView, TSharedPtr<FVisualLoggerTimeSliderController> TimeSliderController, TSharedPtr<STimelinesContainer> InContainer, const FVisualLogDevice::FVisualLogEntryItem& Entry)
{
VisualLoggerInterface = InArgs._VisualLoggerInterface.Get();
OnGetMenuContent = InArgs._OnGetMenuContent;
Owner = InContainer;
Name = Entry.OwnerName;
Entries.Add(Entry);
OnFiltersChanged();
ULogVisualizerSettings::StaticClass()->GetDefaultObject<ULogVisualizerSettings>()->OnSettingChanged().AddRaw(this, &STimeline::HandleLogVisualizerSettingChanged);
ChildSlot
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.Padding(FMargin(0, 4, 0, 0))
.HAlign(HAlign_Fill)
.VAlign(VAlign_Fill)
.FillWidth(TAttribute<float>(VisualLoggerView.Get(), &SVisualLoggerView::GetAnimationOutlinerFillPercentage))
[
SAssignNew(PopupAnchor, STimelineLabelAnchor, SharedThis(this))
.OnGetMenuContent(OnGetMenuContent)
[
SNew(SBorder)
.HAlign(HAlign_Fill)
.Padding(FMargin(0, 0, 4, 0))
.BorderImage(FCoreStyle::Get().GetBrush("NoBorder"))
[
SNew(SBorder)
.VAlign(VAlign_Center)
.BorderImage(this, &STimeline::GetBorder)
.Padding(FMargin(4, 0, 2, 0))
[
// Search box for searching through the outliner
SNew(STextBlock)
.Text(FString(Name.ToString()))
.ShadowOffset(FVector2D(1.f, 1.f))
]
]
]
]
+ SHorizontalBox::Slot()
.Padding(FMargin(0, 4, 0, 0))
.HAlign(HAlign_Left)
[
SNew(SBox)
.Padding(FMargin(0, 0, 0, 0))
.HAlign(HAlign_Left)
[
// Search box for searching through the outliner
SAssignNew(TimelineBar, STimelineBar, TimeSliderController, SharedThis(this))
.VisualLoggerInterface(InArgs._VisualLoggerInterface)
]
]
];
}
示例8: MakeShareable
TSharedPtr< FSlateStyleSet > FSlateFileDialogsStyle::Create()
{
TSharedPtr< FSlateStyleSet > Style = MakeShareable(new FSlateStyleSet(FSlateFileDialogsStyle::GetStyleSetName()));
Style->SetContentRoot(FPaths::EngineContentDir());
const FVector2D Icon10x10(10.0f, 10.0f);
const FVector2D Icon16x16(16.0f, 16.0f);
const FVector2D Icon24x24(24.0f, 24.0f);
const FVector2D Icon64x64(64.0f, 64.0f);
const FSlateColor InvertedForeground(FLinearColor(0.0f, 0.0f, 0.0f));
const FSlateColor SelectionColor(FLinearColor(0.701f, 0.225f, 0.003f));
const FSlateColor SelectionColor_Inactive(FLinearColor(0.25f, 0.25f, 0.25f));
const FSlateColor SelectionColor_Pressed(FLinearColor(0.701f, 0.225f, 0.003f));
// SButton defaults...
const FButtonStyle Button = FButtonStyle()
.SetNormal( BOX_BRUSH( "Slate/Common/Button", FVector2D(32,32), 8.0f/32.0f ) )
.SetHovered( BOX_BRUSH( "Slate/Common/Button_Hovered", FVector2D(32,32), 8.0f/32.0f ) )
.SetPressed( BOX_BRUSH( "Slate/Common/Button_Pressed", FVector2D(32,32), 8.0f/32.0f ) )
.SetDisabled( BOX_BRUSH( "Slate/Common/Button_Disabled", 8.0f/32.0f ) )
.SetNormalPadding( FMargin( 2,2,2,2 ) )
.SetPressedPadding( FMargin( 2,3,2,1 ) );
{
Style->Set( "Button", Button );
Style->Set( "InvertedForeground", InvertedForeground );
}
Style->Set("SlateFileDialogs.Dialog", TTF_FONT("Slate/Fonts/Roboto-Regular", 10));
Style->Set("SlateFileDialogs.DialogBold", TTF_FONT("Slate/Fonts/Roboto-Bold", 10));
Style->Set("SlateFileDialogs.DialogLarge", TTF_FONT("Slate/Fonts/Roboto-Bold", 16));
Style->Set("SlateFileDialogs.DirectoryItem", TTF_FONT("Slate/Fonts/Roboto-Bold", 11));
Style->Set( "SlateFileDialogs.GroupBorder", new BOX_BRUSH( "Slate/Common/GroupBorder", FMargin(4.0f/16.0f) ) );
Style->Set("SlateFileDialogs.Folder16", new IMAGE_BRUSH("SlateFileDialogs/Icons/icon_file_folder_16x", Icon16x16));
Style->Set("SlateFileDialogs.Folder24", new IMAGE_BRUSH("SlateFileDialogs/Icons/icon_file_folder_40x", Icon24x24));
Style->Set("SlateFileDialogs.NewFolder24", new IMAGE_BRUSH("SlateFileDialogs/Icons/icon_new_folder_40x", Icon24x24));
Style->Set("SlateFileDialogs.WhiteBackground", new IMAGE_BRUSH("SlateFileDialogs/Common/Window/WindowWhite", Icon64x64));
Style->Set( "SlateFileDialogs.PathDelimiter", new IMAGE_BRUSH( "SlateFileDialogs/Common/SmallArrowRight", Icon10x10 ) );
Style->Set( "SlateFileDialogs.PathText", FTextBlockStyle()
.SetFont( TTF_FONT( "Slate/Fonts/Roboto-Bold", 11 ) )
.SetColorAndOpacity( FLinearColor( 1.0f, 1.0f, 1.0f ) )
.SetHighlightColor( FLinearColor( 1.0f, 1.0f, 1.0f ) )
.SetHighlightShape(BOX_BRUSH("Slate/Common/TextBlockHighlightShape", FMargin(3.f /8.f)))
.SetShadowOffset( FVector2D( 1,1 ) )
.SetShadowColorAndOpacity( FLinearColor(0,0,0,0.9f) ) );
Style->Set("SlateFileDialogs.FlatButton", FButtonStyle(Button)
.SetNormal(FSlateNoResource())
.SetHovered(BOX_BRUSH("SlateFileDialogs/Common/FlatButton", 2.0f / 8.0f, SelectionColor))
.SetPressed(BOX_BRUSH("SlateFileDialogs/Common/FlatButton", 2.0f / 8.0f, SelectionColor_Pressed))
);
return Style;
}
示例9: MakeLightingDensityMenu
/** Generates a lighting density sub-menu */
static void MakeLightingDensityMenu( FMenuBuilder& InMenuBuilder )
{
InMenuBuilder.BeginSection("LevelEditorBuildLightingDensity", LOCTEXT( "LightingDensityHeading", "Density Rendering" ) );
{
TSharedRef<SWidget> Ideal = SNew(SHorizontalBox)
+SHorizontalBox::Slot()
.Padding( FMargin( 27.0f, 0.0f, 0.0f, 0.0f ) )
.FillWidth(1.0f)
[
SNew(SSpinBox<float>)
.MinValue(0.f)
.MaxValue(100.f)
.Value(FLevelEditorActionCallbacks::GetLightingDensityIdeal())
.OnValueChanged_Static(&FLevelEditorActionCallbacks::SetLightingDensityIdeal)
];
InMenuBuilder.AddWidget(Ideal, LOCTEXT("LightingDensity_Ideal","Ideal Density"));
TSharedRef<SWidget> Maximum = SNew(SHorizontalBox)
+SHorizontalBox::Slot()
.FillWidth(1.0f)
[
SNew(SSpinBox<float>)
.MinValue(0.01f)
.MaxValue(100.01f)
.Value(FLevelEditorActionCallbacks::GetLightingDensityMaximum())
.OnValueChanged_Static(&FLevelEditorActionCallbacks::SetLightingDensityMaximum)
];
InMenuBuilder.AddWidget(Maximum, LOCTEXT("LightingDensity_Maximum","Maximum Density"));
TSharedRef<SWidget> ClrScale = SNew(SHorizontalBox)
+SHorizontalBox::Slot()
.Padding( FMargin( 35.0f, 0.0f, 0.0f, 0.0f ) )
.FillWidth(1.0f)
[
SNew(SSpinBox<float>)
.MinValue(0.f)
.MaxValue(10.f)
.Value(FLevelEditorActionCallbacks::GetLightingDensityColorScale())
.OnValueChanged_Static(&FLevelEditorActionCallbacks::SetLightingDensityColorScale)
];
InMenuBuilder.AddWidget(ClrScale, LOCTEXT("LightingDensity_ColorScale","Color Scale"));
TSharedRef<SWidget> GrayScale = SNew(SHorizontalBox)
+SHorizontalBox::Slot()
.Padding( FMargin( 11.0f, 0.0f, 0.0f, 0.0f ) )
.FillWidth(1.0f)
[
SNew(SSpinBox<float>)
.MinValue(0.f)
.MaxValue(10.f)
.Value(FLevelEditorActionCallbacks::GetLightingDensityGrayscaleScale())
.OnValueChanged_Static(&FLevelEditorActionCallbacks::SetLightingDensityGrayscaleScale)
];
InMenuBuilder.AddWidget(GrayScale, LOCTEXT("LightingDensity_GrayscaleScale","Grayscale Scale"));
InMenuBuilder.AddMenuEntry( FLevelEditorCommands::Get().LightingDensity_RenderGrayscale );
}
InMenuBuilder.EndSection();
}
示例10: SNew
void SSessionConsoleCommandBar::Construct( const FArguments& InArgs )
{
OnCommandSubmitted = InArgs._OnCommandSubmitted;
OnPromoteToShortcutClicked = InArgs._OnPromoteToShortcutClicked;
ChildSlot
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.FillWidth(1.0f)
[
// command input
SAssignNew(InputTextBox, SSuggestionTextBox)
.ClearKeyboardFocusOnCommit(false)
.OnShowingHistory(this, &SSessionConsoleCommandBar::HandleInputTextShowingHistory)
.OnShowingSuggestions(this, &SSessionConsoleCommandBar::HandleInputTextShowingSuggestions)
.OnTextChanged(this, &SSessionConsoleCommandBar::HandleInputTextChanged)
.OnTextCommitted(this, &SSessionConsoleCommandBar::HandleInputTextCommitted)
]
+ SHorizontalBox::Slot()
.AutoWidth()
.Padding(4.0f, 0.0f, 0.0f, 0.0f)
[
// send button
SAssignNew(SendButton, SButton)
.ContentPadding(FMargin(6.0f, 2.0f))
.IsEnabled(false)
.OnClicked(this, &SSessionConsoleCommandBar::HandleSendButtonClicked)
.ToolTipText(LOCTEXT("SendButtonTooltip", "Send the command"))
[
SNew(STextBlock)
.Text(LOCTEXT("SendButtonLabel", "Send Command"))
]
]
+ SHorizontalBox::Slot()
.AutoWidth()
.Padding(4.0f, 0.0f, 0.0f, 0.0f)
[
// send button
SAssignNew(PromoteToShortcutButton, SButton)
.ContentPadding(FMargin(6.0f, 2.0f))
.IsEnabled(false)
.OnClicked(this, &SSessionConsoleCommandBar::HandlePromoteToShortcutButtonClicked)
.ToolTipText(LOCTEXT("PromoteConsoleCommandButtonTooltip", "Promote Command to Shortcut"))
[
SNew(STextBlock)
.Text(LOCTEXT("PromoteConsoleCommandButtonLabel", "Promote to Shortcut"))
]
]
];
}
示例11: FMargin
void SSafeZone::SetTitleSafe( bool bIsTitleSafe )
{
FDisplayMetrics Metrics;
FSlateApplication::Get().GetDisplayMetrics( Metrics );
if ( bIsTitleSafe )
{
SafeMargin = FMargin( Metrics.TitleSafePaddingSize.X, Metrics.TitleSafePaddingSize.Y );
}
else
{
SafeMargin = FMargin( Metrics.ActionSafePaddingSize.X, Metrics.ActionSafePaddingSize.Y );
}
}
示例12: MakeShareable
TSharedRef< FSlateStyleSet > FFriendsAndChatModuleStyle::Create(FFriendsAndChatStyle FriendStyle)
{
TSharedRef< FSlateStyleSet > Style = MakeShareable(new FSlateStyleSet("FriendsAndChatStyle"));
const FTextBlockStyle DefaultText = FTextBlockStyle()
.SetFont(FriendStyle.FriendsFontStyleSmall);
// Name Style
const FTextBlockStyle GlobalChatFont = FTextBlockStyle(DefaultText)
.SetFont(FriendStyle.FriendsFontStyleSmallBold)
.SetColorAndOpacity(FriendStyle.DefaultChatColor);
const FTextBlockStyle PartyChatFont = FTextBlockStyle(DefaultText)
.SetFont(FriendStyle.FriendsFontStyleSmallBold)
.SetColorAndOpacity(FriendStyle.PartyChatColor);
const FTextBlockStyle WhisperChatFont = FTextBlockStyle(DefaultText)
.SetFont(FriendStyle.FriendsFontStyleSmallBold)
.SetColorAndOpacity(FriendStyle.WhisplerChatColor);
const FButtonStyle UserNameButton = FButtonStyle()
.SetNormal(FSlateNoResource())
.SetPressed(FSlateNoResource())
.SetHovered(FSlateNoResource());
const FHyperlinkStyle GlobalChatHyperlink = FHyperlinkStyle()
.SetUnderlineStyle(UserNameButton)
.SetTextStyle(GlobalChatFont)
.SetPadding(FMargin(0.0f));
const FHyperlinkStyle PartyChatHyperlink = FHyperlinkStyle()
.SetUnderlineStyle(UserNameButton)
.SetTextStyle(PartyChatFont)
.SetPadding(FMargin(0.0f));
const FHyperlinkStyle WhisperChatHyperlink = FHyperlinkStyle()
.SetUnderlineStyle(UserNameButton)
.SetTextStyle(WhisperChatFont)
.SetPadding(FMargin(0.0f));
Style->Set("UserNameTextStyle.GlobalHyperlink", GlobalChatHyperlink);
Style->Set("UserNameTextStyle.PartyHyperlink", PartyChatHyperlink);
Style->Set("UserNameTextStyle.Whisperlink", WhisperChatHyperlink);
Style->Set("UserNameTextStyle.GlobalTextStyle", GlobalChatFont);
Style->Set("UserNameTextStyle.PartyTextStyle", PartyChatFont);
Style->Set("UserNameTextStyle.WhisperTextStyle", WhisperChatFont);
return Style;
}
示例13: GenerateWidgetForColumn
virtual TSharedRef<SWidget> GenerateWidgetForColumn(const FName& ColumnName) override
{
if (ColumnName == TEXT("Quality Option"))
{
return SNew(SBox)
.HeightOverride(20)
.Padding(FMargin(3, 0))
.VAlign(VAlign_Center)
[
SNew(STextBlock)
.Text(FText::FromString(Item->RangeName))
.Font(IDetailLayoutBuilder::GetDetailFont())
];
}
else
{
EMaterialQualityLevel::Type MaterialQualityLevel = EMaterialQualityLevel::Num;
if (ColumnName == TEXT("Low"))
{
MaterialQualityLevel = EMaterialQualityLevel::Low;
}
else if (ColumnName == TEXT("Medium"))
{
MaterialQualityLevel = EMaterialQualityLevel::Medium;
}
else if (ColumnName == TEXT("High"))
{
MaterialQualityLevel = EMaterialQualityLevel::High;
}
if (MaterialQualityLevel < EMaterialQualityLevel::Num)
{
return SNew(SBox)
.HeightOverride(20)
.Padding(FMargin(3, 0))
.VAlign(VAlign_Center)
[
SNew(SCheckBox)
.OnCheckStateChanged(this, &SQualityListItem::OnQualityRangeChanged, MaterialQualityLevel)
.IsChecked(this, &SQualityListItem::IsQualityRangeSet, MaterialQualityLevel)
.IsEnabled(this, &SQualityListItem::IsEnabled, MaterialQualityLevel)
];
}
}
return SNullWidget::NullWidget;
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:48,代码来源:MaterialShaderQualitySettingsCustomization.cpp
示例14: SNew
void FLandscapeEditorStructCustomization_FGizmoImportLayer::CustomizeStructChildren(TSharedRef<IPropertyHandle> StructPropertyHandle, class IDetailChildrenBuilder& ChildBuilder, IStructCustomizationUtils& StructCustomizationUtils)
{
TSharedRef<IPropertyHandle> PropertyHandle_LayerFilename = StructPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FGizmoImportLayer, LayerFilename)).ToSharedRef();
ChildBuilder.AddChildProperty(PropertyHandle_LayerFilename)
.CustomWidget()
.NameContent()
[
PropertyHandle_LayerFilename->CreatePropertyNameWidget()
]
.ValueContent()
.MinDesiredWidth(250.0f)
.MaxDesiredWidth(0)
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
[
PropertyHandle_LayerFilename->CreatePropertyValueWidget()
]
+ SHorizontalBox::Slot()
.AutoWidth()
//.Padding(0,0,12,0) // Line up with the other properties due to having no reset to default button
[
SNew(SButton)
.ContentPadding(FMargin(4, 0))
.Text(NSLOCTEXT("UnrealEd", "GenericOpenDialog", "..."))
.OnClicked_Static(&FLandscapeEditorStructCustomization_FGizmoImportLayer::OnGizmoImportLayerFilenameButtonClicked, PropertyHandle_LayerFilename)
]
];
TSharedRef<IPropertyHandle> PropertyHandle_LayerName = StructPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FGizmoImportLayer, LayerName)).ToSharedRef();
ChildBuilder.AddChildProperty(PropertyHandle_LayerName);
}
示例15: DetailsViewArgs
void SFacialAnimationBulkImporter::Construct(const FArguments& InArgs)
{
FDetailsViewArgs DetailsViewArgs(false, false, true, FDetailsViewArgs::HideNameArea);
FPropertyEditorModule& PropertyEditorModule = FModuleManager::Get().GetModuleChecked<FPropertyEditorModule>("PropertyEditor");
TSharedRef<IDetailsView> DetailsView = PropertyEditorModule.CreateDetailView(DetailsViewArgs);
DetailsView->SetObject(GetMutableDefault<UFacialAnimationBulkImporterSettings>());
ChildSlot
[
SNew(SVerticalBox)
+SVerticalBox::Slot()
.FillHeight(1.0f)
[
DetailsView
]
+SVerticalBox::Slot()
.AutoHeight()
.HAlign(HAlign_Right)
.Padding(4.0f)
[
SNew(SButton)
.ButtonStyle(FEditorStyle::Get(), "FlatButton.Success")
.ForegroundColor(FLinearColor::White)
.ContentPadding(FMargin(6, 2))
.IsEnabled(this, &SFacialAnimationBulkImporter::IsImportButtonEnabled)
.OnClicked(this, &SFacialAnimationBulkImporter::HandleImportClicked)
[
SNew(STextBlock)
.TextStyle(FEditorStyle::Get(), "ContentBrowser.TopBar.Font")
.Text(LOCTEXT("ImportAllButton", "Import All"))
]
]
];
}