TSharedRef< FSlateStyleSet > FCrashReportClientStyle::Create() { TSharedRef<FSlateStyleSet> StyleRef = MakeShareable(new FSlateStyleSet("CrashReportClientStyle")); FSlateStyleSet& Style = StyleRef.Get(); const FTextBlockStyle DefaultText = FTextBlockStyle() .SetFont(TTF_FONT("Fonts/Roboto-Black", 10)) .SetColorAndOpacity(FSlateColor::UseForeground()) .SetShadowOffset(FVector2D::ZeroVector) .SetShadowColorAndOpacity(FLinearColor::Black); // Set the client app styles Style.Set(TEXT("Code"), FTextBlockStyle(DefaultText) .SetFont(TTF_FONT("Fonts/DroidSansMono", 8)) .SetColorAndOpacity(FSlateColor(FLinearColor::White * 0.8f)) ); Style.Set(TEXT("Title"), FTextBlockStyle(DefaultText) .SetFont(TTF_FONT("Fonts/Roboto-Bold", 12)) ); Style.Set(TEXT("Status"), FTextBlockStyle(DefaultText) .SetColorAndOpacity(FSlateColor::UseSubduedForeground()) ); return StyleRef; }
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; }
TSharedRef< FSlateStyleSet > FCrashReportClientStyle::Create() { TSharedRef<FSlateStyleSet> StyleRef = MakeShareable(new FSlateStyleSet("CrashReportClientStyle")); FSlateStyleSet& Style = StyleRef.Get(); const FTextBlockStyle DefaultText = FTextBlockStyle() .SetFont(TTF_FONT("Fonts/Roboto-Bold", 10)) .SetColorAndOpacity(FSlateColor::UseForeground()) .SetShadowOffset(FVector2D::ZeroVector) .SetShadowColorAndOpacity(FLinearColor::Black); // Set the client app styles Style.Set(TEXT("Code"), FTextBlockStyle(DefaultText) .SetFont(TTF_FONT("Fonts/Roboto-Regular", 8)) .SetColorAndOpacity(FSlateColor(FLinearColor::White * 0.8f)) ); Style.Set(TEXT("Title"), FTextBlockStyle(DefaultText) .SetFont(TTF_FONT("Fonts/Roboto-Bold", 12)) ); Style.Set(TEXT("Status"), FTextBlockStyle(DefaultText) .SetColorAndOpacity(FSlateColor::UseSubduedForeground()) ); const FVector2D Icon16x16( 16.0f, 16.0f ); FSlateBrush* GenericWhiteBox = new IMAGE_BRUSH( "Old/White", Icon16x16 ); // SEditableTextBox defaults... const FScrollBarStyle& ScrollBarStyle = FCoreStyle::Get().GetWidgetStyle<FScrollBarStyle>( "ScrollBar" ); const FEditableTextBoxStyle NormalEditableTextBoxStyle = FEditableTextBoxStyle() .SetBackgroundImageNormal( *GenericWhiteBox ) .SetBackgroundImageHovered( *GenericWhiteBox ) .SetBackgroundImageFocused( *GenericWhiteBox ) .SetBackgroundImageReadOnly( *GenericWhiteBox ) .SetScrollBarStyle( ScrollBarStyle ); { Style.Set( "NormalEditableTextBox", NormalEditableTextBoxStyle ); } return StyleRef; }
TSharedRef< FSlateStyleSet > FPluginCreatorStyle::Create() { TSharedRef< FSlateStyleSet > Style = MakeShareable(new FSlateStyleSet("PCStyle")); Style->SetContentRoot(FPaths::EngineContentDir() / TEXT("Slate")); const FTextBlockStyle TabButtonText = FTextBlockStyle() .SetFont(TTF_FONT("Fonts/Roboto-Bold", 10)) .SetColorAndOpacity(FSlateColor::UseForeground()) .SetShadowColorAndOpacity(FLinearColor::Black) .SetHighlightColor(FLinearColor(0.02f, 0.3f, 0.0f)) .SetShadowOffset(FVector2D(-1, 1)) .SetHighlightShape(BOX_BRUSH("Common/TextBlockHighlightShape", FMargin(3.f / 8.f))); Style->Set("TabButton.Text", TabButtonText); Style->Set("PluginNameFont", TTF_FONT("Fonts/Roboto-Bold", 18)); Style->SetContentRoot(GetPluginCreatorRootPath() / TEXT("Resources")); Style->Set("DefaultPluginIcon", new IMAGE_BRUSH(TEXT("DefaultIcon128"), Icon128x128)); Style->Set("BlankPluginSource", new IMAGE_BRUSH(TEXT("blankpluginSource"), FVector2D(301, 200))); Style->Set("BasicPluginSource", new IMAGE_BRUSH(TEXT("basicpluginSource"), FVector2D(288, 290))); const FButtonStyle NoBorder = FButtonStyle() .SetNormal(FSlateNoResource()) .SetHovered(FSlateNoResource()) .SetPressed(FSlateNoResource()) .SetNormalPadding(FMargin(0, 0, 0, 1)) .SetPressedPadding(FMargin(0, 1, 0, 0)); Style->Set("NoBorderButton", NoBorder); Style->Set("NoBorder", new FSlateNoResource()); Style->Set("DarkGrayBackground", new BOX_BRUSH("DarkGrayBackground", FMargin(4 / 16.0f))); return Style; }
TSharedRef< FSlateStyleSet > FFirstLevelStyle::Create() { TSharedRef<FSlateStyleSet> StyleRef = FSlateGameResources::New(FFirstLevelStyle::GetStyleSetName(), "/Game/UI/Styles", "/Game/UI/Styles"); FSlateStyleSet& Style = StyleRef.Get(); const FLinearColor GoldColor(FColor(255, 213, 160)); // Fonts still need to be specified in code for now Style.Set("StrategyGame.MenuFont", TTF_FONT("Fonts/Roboto-Black", 32)); Style.Set("StrategyGame.ResourcesTextStyle", FTextBlockStyle() .SetFont(TTF_FONT("Fonts/Roboto-Regular", 40)) .SetColorAndOpacity(GoldColor) .SetShadowColorAndOpacity(FLinearColor::Black) .SetShadowOffset(FIntPoint(-1, 1)) ); Style.Set("StrategyGame.ButtonFont", TTF_FONT("Fonts/Roboto-Black", 18)); return StyleRef; }
TSharedRef< FSlateStyleSet > FAllarBuilderClientStyle::Create() { const FVector2D Icon16x16(16.0f, 16.0f); const FVector2D Icon32x32(32.0f, 32.0f); const FVector2D Icon48x48(48.0f, 48.0f); const FVector2D Icon64x64(64.0f, 64.0f); TSharedRef<FSlateStyleSet> StyleRef = MakeShareable(new FSlateStyleSet("FAllarBuilderClientStyle")); FSlateStyleSet& Style = StyleRef.Get(); const FTextBlockStyle DefaultText = FTextBlockStyle() .SetFont(TTF_FONT("Fonts/Roboto-Regular", 10)) .SetColorAndOpacity(FSlateColor::UseForeground()) .SetShadowOffset(FVector2D::ZeroVector) .SetShadowColorAndOpacity(FLinearColor::Black); // Set the client app styles Style.Set(TEXT("Background"), new IMAGE_BRUSH("Common/NoiseBackground", Icon64x64, FLinearColor(1,1,1,1), ESlateBrushTileType::Both)); Style.Set(TEXT("ProjectPicker.Text"), FTextBlockStyle(DefaultText) .SetFont(TTF_FONT("Fonts/Roboto-Regular", 24)) ); Style.Set(TEXT("ProjectPicker.ErrorImage"), new IMAGE_BRUSH("Icons/icon_error_16x", Icon32x32)); Style.Set(TEXT("Section.Label"), FTextBlockStyle(DefaultText) .SetFont(TTF_FONT("Fonts/Roboto-Bold", 18)) ); Style.Set(TEXT("Section.Border"), new BOX_BRUSH("Common/GroupBorder", FMargin(4.0f / 16.0f))); Style.Set(TEXT("Section.Text"), FTextBlockStyle(DefaultText) .SetFont(TTF_FONT("Fonts/Roboto-Regular", 10)) ); Style.Set(TEXT("Code"), FTextBlockStyle(DefaultText) .SetFont(TTF_FONT("Fonts/Roboto-Regular", 8)) .SetColorAndOpacity(FSlateColor(FLinearColor::White * 0.8f)) ); Style.Set(TEXT("Title"), FTextBlockStyle(DefaultText) .SetFont(TTF_FONT("Fonts/Roboto-Bold", 12)) ); Style.Set(TEXT("Status"), FTextBlockStyle(DefaultText) .SetColorAndOpacity(FSlateColor::UseSubduedForeground()) ); FSlateBrush* GenericWhiteBox = new IMAGE_BRUSH("Old/White", Icon16x16); // Scrollbar const FScrollBarStyle ScrollBar = FScrollBarStyle() .SetVerticalTopSlotImage(IMAGE_BRUSH("Common/Scrollbar_Background_Vertical", FVector2D(8, 8))) .SetVerticalBottomSlotImage(IMAGE_BRUSH("Common/Scrollbar_Background_Vertical", FVector2D(8, 8))) .SetHorizontalTopSlotImage(IMAGE_BRUSH("Common/Scrollbar_Background_Horizontal", FVector2D(8, 8))) .SetHorizontalBottomSlotImage(IMAGE_BRUSH("Common/Scrollbar_Background_Horizontal", FVector2D(8, 8))) .SetNormalThumbImage(BOX_BRUSH("Common/Scrollbar_Thumb", FMargin(4.f / 16.f))) .SetDraggedThumbImage(BOX_BRUSH("Common/Scrollbar_Thumb", FMargin(4.f / 16.f))) .SetHoveredThumbImage(BOX_BRUSH("Common/Scrollbar_Thumb", FMargin(4.f / 16.f))); // SEditableTextBox defaults... const FEditableTextBoxStyle NormalEditableTextBoxStyle = FEditableTextBoxStyle() .SetBackgroundImageNormal(*GenericWhiteBox) .SetBackgroundImageHovered(*GenericWhiteBox) .SetBackgroundImageFocused(*GenericWhiteBox) .SetBackgroundImageReadOnly(*GenericWhiteBox) .SetScrollBarStyle(ScrollBar); { Style.Set("NormalEditableTextBox", NormalEditableTextBoxStyle); } // RichText const FTextBlockStyle AllarBuilderDataStyle = FTextBlockStyle() .SetFont(TTF_FONT("Testing/Fonts/Roboto-Italic", 9)) .SetColorAndOpacity(FSlateColor(FLinearColor::White * 0.5f)) .SetShadowOffset(FVector2D::ZeroVector) .SetShadowColorAndOpacity(FLinearColor::Black); Style.Set("AllarBuilderDataStyle", AllarBuilderDataStyle); FButtonStyle DarkHyperlinkButton = FButtonStyle() .SetNormal(BORDER_BRUSH("Old/HyperlinkDotted", FMargin(0, 0, 0, 3 / 16.0f), FSlateColor(FLinearColor::White * 0.5f))) .SetPressed(FSlateNoResource()) .SetHovered(BORDER_BRUSH("Old/HyperlinkUnderline", FMargin(0, 0, 0, 3 / 16.0f), FSlateColor(FLinearColor::White * 0.5f))); const FHyperlinkStyle DarkHyperlink = FHyperlinkStyle() .SetUnderlineStyle(DarkHyperlinkButton) .SetTextStyle(AllarBuilderDataStyle) .SetPadding(FMargin(0.0f)); Style.Set("RichText.Hyperlink", DarkHyperlink); return StyleRef; }
void FCodeEditorStyle::Initialize() { // Only register once if( StyleSet.IsValid() ) { return; } StyleSet = MakeShareable(new FSlateStyleSet("CodeEditor") ); StyleSet->SetContentRoot(FPaths::EnginePluginsDir() / TEXT("Experimental/CodeEditor/Resources")); // Icons { StyleSet->Set("CodeEditor.TabIcon", new IMAGE_BRUSH("UI/CodeEditor_16x", Icon16x16)); StyleSet->Set("CodeEditor.Save", new IMAGE_BRUSH("UI/Save_40x", Icon40x40)); StyleSet->Set("CodeEditor.Save.Small", new IMAGE_BRUSH("UI/Save_40x", Icon16x16)); StyleSet->Set("CodeEditor.SaveAll", new IMAGE_BRUSH("UI/SaveAll_40x", Icon40x40)); StyleSet->Set("CodeEditor.SaveAll.Small", new IMAGE_BRUSH("UI/SaveAll_40x", Icon16x16)); } const FSlateFontInfo Consolas10 = TTF_FONT("Font/DroidSansMono", 9); const FTextBlockStyle NormalText = FTextBlockStyle() .SetFont(Consolas10) .SetColorAndOpacity(FLinearColor::White) .SetShadowOffset(FVector2D::ZeroVector) .SetShadowColorAndOpacity(FLinearColor::Black) .SetHighlightColor(FLinearColor(0.02f, 0.3f, 0.0f)) .SetHighlightShape(BOX_BRUSH("UI/TextBlockHighlightShape", FMargin(3.f / 8.f))); // Text editor { StyleSet->Set("TextEditor.NormalText", NormalText); StyleSet->Set("SyntaxHighlight.CPP.Normal", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xffdfd706))));// yellow StyleSet->Set("SyntaxHighlight.CPP.Operator", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xffcfcfcf)))); // light grey StyleSet->Set("SyntaxHighlight.CPP.Keyword", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xff006ab4)))); // blue StyleSet->Set("SyntaxHighlight.CPP.String", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xff9e4a1e)))); // pinkish StyleSet->Set("SyntaxHighlight.CPP.Number", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xff6db3a8)))); // cyan StyleSet->Set("SyntaxHighlight.CPP.Comment", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xff57a64a)))); // green StyleSet->Set("SyntaxHighlight.CPP.PreProcessorKeyword", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xffcfcfcf)))); // light grey StyleSet->Set("TextEditor.Border", new BOX_BRUSH("UI/TextEditorBorder", FMargin(4.0f/16.0f), FLinearColor(0.02f,0.02f,0.02f,1))); const FEditableTextBoxStyle EditableTextBoxStyle = FEditableTextBoxStyle() .SetBackgroundImageNormal( FSlateNoResource() ) .SetBackgroundImageHovered( FSlateNoResource() ) .SetBackgroundImageFocused( FSlateNoResource() ) .SetBackgroundImageReadOnly( FSlateNoResource() ); StyleSet->Set("TextEditor.EditableTextBox", EditableTextBoxStyle); } // Project editor { StyleSet->Set("ProjectEditor.Border", new BOX_BRUSH("UI/TextEditorBorder", FMargin(4.0f/16.0f), FLinearColor(0.048f,0.048f,0.048f,1))); StyleSet->Set("ProjectEditor.Icon.Project", new IMAGE_BRUSH("UI/FolderClosed", Icon16x16, FLinearColor(0.25f,0.25f,0.25f,1))); StyleSet->Set("ProjectEditor.Icon.Folder", new IMAGE_BRUSH("UI/FolderClosed", Icon16x16, FLinearColor(0.25f,0.25f,0.25f,1))); StyleSet->Set("ProjectEditor.Icon.File", new IMAGE_BRUSH("UI/GenericFile", Icon16x16)); StyleSet->Set("ProjectEditor.Icon.GenericFile", new IMAGE_BRUSH("UI/GenericFile", Icon16x16)); } FSlateStyleRegistry::RegisterSlateStyle( *StyleSet.Get() ); }
void FPythonEditorStyle::Initialize() { // Only register once if( StyleSet.IsValid() ) { return; } StyleSet = MakeShareable(new FSlateStyleSet("PythonEditor") ); StyleSet->SetContentRoot(IPluginManager::Get().FindPlugin("UnrealEnginePython")->GetBaseDir() / TEXT("Resources")); // Icons { StyleSet->Set("PythonEditor.TabIcon", new IMAGE_BRUSH("UI/PythonEditor_16x", Icon16x16)); StyleSet->Set("PythonEditor.New", new IMAGE_BRUSH("UI/GenericFile", Icon40x40)); StyleSet->Set("PythonEditor.NewDirectory", new IMAGE_BRUSH("UI/GenericFile", Icon40x40)); StyleSet->Set("PythonEditor.New.Small", new IMAGE_BRUSH("UI/GenericFile", Icon16x16)); StyleSet->Set("PythonEditor.Delete", new IMAGE_BRUSH("UI/DeleteFile", Icon40x40)); StyleSet->Set("PythonEditor.Delete.Small", new IMAGE_BRUSH("UI/DeleteFile", Icon16x16)); StyleSet->Set("PythonEditor.Save", new IMAGE_BRUSH("UI/Save_40x", Icon40x40)); StyleSet->Set("PythonEditor.Save.Small", new IMAGE_BRUSH("UI/Save_40x", Icon16x16)); StyleSet->Set("PythonEditor.SaveAll", new IMAGE_BRUSH("UI/SaveAll_40x", Icon40x40)); StyleSet->Set("PythonEditor.SaveAll.Small", new IMAGE_BRUSH("UI/SaveAll_40x", Icon16x16)); StyleSet->Set("PythonEditor.Execute", new IMAGE_BRUSH("UI/Excute_x40", Icon40x40)); StyleSet->Set("PythonEditor.Execute.Small", new IMAGE_BRUSH("UI/Excute_x40", Icon16x16)); StyleSet->Set("PythonEditor.ExecuteInSandbox", new IMAGE_BRUSH("UI/Excute_x40", Icon40x40)); StyleSet->Set("PythonEditor.ExecuteInSandbox.Small", new IMAGE_BRUSH("UI/Excute_x40", Icon16x16)); StyleSet->Set("PythonEditor.PEP8ize", new IMAGE_BRUSH("UI/Excute_x40", Icon40x40)); StyleSet->Set("PythonEditor.PEP8ize.Small", new IMAGE_BRUSH("UI/Excute_x40", Icon16x16)); } const FSlateFontInfo Consolas10 = TTF_FONT("Font/DroidSansMono", 9); const FTextBlockStyle NormalText = FTextBlockStyle() .SetFont(Consolas10) .SetColorAndOpacity(FLinearColor::White) .SetShadowOffset(FVector2D::ZeroVector) .SetShadowColorAndOpacity(FLinearColor::Black) .SetHighlightColor(FLinearColor(0.02f, 0.3f, 0.0f)) .SetHighlightShape(BOX_BRUSH("UI/TextBlockHighlightShape", FMargin(3.f / 8.f))); // Text editor { StyleSet->Set("TextEditor.NormalText", NormalText); StyleSet->Set("SyntaxHighlight.PY.Normal", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xffffffff))));// yellow StyleSet->Set("SyntaxHighlight.PY.Operator", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xfff92672)))); // light grey StyleSet->Set("SyntaxHighlight.PY.Keyword", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xfff92672)))); // blue StyleSet->Set("SyntaxHighlight.PY.String", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xffe6db74)))); // pinkish StyleSet->Set("SyntaxHighlight.PY.Number", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xffae81dd)))); // cyan StyleSet->Set("SyntaxHighlight.PY.Comment", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xff75715e)))); // green StyleSet->Set("SyntaxHighlight.PY.BuiltIn", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xff52d9ef)))); // light grey StyleSet->Set("SyntaxHighlight.PY.Define", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xffa6e22a)))); // light grey StyleSet->Set("TextEditor.Border", new BOX_BRUSH("UI/TextEditorBorder", FMargin(4.0f/16.0f), FLinearColor(0.02f,0.02f,0.02f,1))); const FEditableTextBoxStyle EditableTextBoxStyle = FEditableTextBoxStyle() .SetBackgroundImageNormal( FSlateNoResource() ) .SetBackgroundImageHovered( FSlateNoResource() ) .SetBackgroundImageFocused( FSlateNoResource() ) .SetBackgroundImageReadOnly( FSlateNoResource() ); StyleSet->Set("TextEditor.EditableTextBox", EditableTextBoxStyle); } // Project editor { StyleSet->Set("ProjectEditor.Border", new BOX_BRUSH("UI/TextEditorBorder", FMargin(4.0f/16.0f), FLinearColor(0.048f,0.048f,0.048f,1))); StyleSet->Set("ProjectEditor.Icon.Project", new IMAGE_BRUSH("UI/FolderClosed", Icon16x16, FLinearColor(0.25f,0.25f,0.25f,1))); StyleSet->Set("ProjectEditor.Icon.Folder", new IMAGE_BRUSH("UI/FolderClosed", Icon16x16, FLinearColor(0.25f,0.25f,0.25f,1))); StyleSet->Set("ProjectEditor.Icon.File", new IMAGE_BRUSH("UI/PythonEditor_16x", Icon16x16)); StyleSet->Set("ProjectEditor.Icon.GenericFile", new IMAGE_BRUSH("UI/GenericFile", Icon16x16)); } FSlateStyleRegistry::RegisterSlateStyle( *StyleSet.Get() ); }
TSharedRef< FSlateStyleSet > FCrashReportClientStyle::Create() { TSharedRef<FSlateStyleSet> StyleRef = MakeShareable(new FSlateStyleSet("CrashReportClientStyle")); FSlateStyleSet& Style = StyleRef.Get(); const FTextBlockStyle DefaultText = FTextBlockStyle() .SetFont(TTF_FONT("Fonts/Roboto-Bold", 10)) .SetColorAndOpacity(FSlateColor::UseForeground()) .SetShadowOffset(FVector2D::ZeroVector) .SetShadowColorAndOpacity(FLinearColor::Black); // Set the client app styles Style.Set(TEXT("Code"), FTextBlockStyle(DefaultText) .SetFont(TTF_FONT("Fonts/Roboto-Regular", 8)) .SetColorAndOpacity(FSlateColor(FLinearColor::White * 0.8f)) ); Style.Set(TEXT("Title"), FTextBlockStyle(DefaultText) .SetFont(TTF_FONT("Fonts/Roboto-Bold", 12)) ); Style.Set(TEXT("Status"), FTextBlockStyle(DefaultText) .SetColorAndOpacity(FSlateColor::UseSubduedForeground()) ); const FVector2D Icon16x16( 16.0f, 16.0f ); FSlateBrush* GenericWhiteBox = new IMAGE_BRUSH( "Old/White", Icon16x16 ); // Scrollbar const FScrollBarStyle ScrollBar = FScrollBarStyle() .SetVerticalTopSlotImage(IMAGE_BRUSH("Common/Scrollbar_Background_Vertical", FVector2D(8, 8))) .SetVerticalBottomSlotImage(IMAGE_BRUSH("Common/Scrollbar_Background_Vertical", FVector2D(8, 8))) .SetHorizontalTopSlotImage(IMAGE_BRUSH("Common/Scrollbar_Background_Horizontal", FVector2D(8, 8))) .SetHorizontalBottomSlotImage(IMAGE_BRUSH("Common/Scrollbar_Background_Horizontal", FVector2D(8, 8))) .SetNormalThumbImage(BOX_BRUSH("Common/Scrollbar_Thumb", FMargin(4.f / 16.f))) .SetDraggedThumbImage(BOX_BRUSH("Common/Scrollbar_Thumb", FMargin(4.f / 16.f))) .SetHoveredThumbImage(BOX_BRUSH("Common/Scrollbar_Thumb", FMargin(4.f / 16.f))); // SEditableTextBox defaults... const FEditableTextBoxStyle NormalEditableTextBoxStyle = FEditableTextBoxStyle() .SetBackgroundImageNormal(*GenericWhiteBox) .SetBackgroundImageHovered(*GenericWhiteBox) .SetBackgroundImageFocused(*GenericWhiteBox) .SetBackgroundImageReadOnly(*GenericWhiteBox) .SetScrollBarStyle(ScrollBar); { Style.Set( "NormalEditableTextBox", NormalEditableTextBoxStyle ); } // RichText const FTextBlockStyle CrashReportDataStyle = FTextBlockStyle() .SetFont( TTF_FONT( "Testing/Fonts/Roboto-Italic", 9 ) ) .SetColorAndOpacity( FSlateColor( FLinearColor::White * 0.5f ) ) .SetShadowOffset( FVector2D::ZeroVector ) .SetShadowColorAndOpacity( FLinearColor::Black ); Style.Set( "CrashReportDataStyle", CrashReportDataStyle ); FButtonStyle DarkHyperlinkButton = FButtonStyle() .SetNormal( BORDER_BRUSH( "Old/HyperlinkDotted", FMargin( 0, 0, 0, 3 / 16.0f ), FSlateColor( FLinearColor::White * 0.5f ) ) ) .SetPressed( FSlateNoResource() ) .SetHovered( BORDER_BRUSH( "Old/HyperlinkUnderline", FMargin( 0, 0, 0, 3 / 16.0f ), FSlateColor( FLinearColor::White * 0.5f ) ) ); const FHyperlinkStyle DarkHyperlink = FHyperlinkStyle() .SetUnderlineStyle( DarkHyperlinkButton ) .SetTextStyle( CrashReportDataStyle ) .SetPadding( FMargin( 0.0f ) ); Style.Set( "RichText.Hyperlink", DarkHyperlink ); return StyleRef; }