diff --git a/Source/PlasticSourceControl/Private/SPlasticSourceControlBranchRow.cpp b/Source/PlasticSourceControl/Private/SPlasticSourceControlBranchRow.cpp index 1e1bec46..1573d119 100644 --- a/Source/PlasticSourceControl/Private/SPlasticSourceControlBranchRow.cpp +++ b/Source/PlasticSourceControl/Private/SPlasticSourceControlBranchRow.cpp @@ -48,7 +48,11 @@ void SPlasticSourceControlBranchRow::Construct(const FArguments& InArgs, const T TSharedRef SPlasticSourceControlBranchRow::GenerateWidgetForColumn(const FName& InColumnId) { +#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1 const FSlateFontInfo FontInfo = bIsCurrentBranch ? FAppStyle::GetFontStyle("BoldFont") : FAppStyle::GetFontStyle("NormalFont"); +#else + const FSlateFontInfo FontInfo = bIsCurrentBranch ? FEditorStyle::GetFontStyle("BoldFont") : FEditorStyle::GetFontStyle("NormalFont"); +#endif if (InColumnId == PlasticSourceControlBranchesListViewColumn::Name::Id()) { @@ -56,7 +60,9 @@ TSharedRef SPlasticSourceControlBranchRow::GenerateWidgetForColumn(cons .Text(FText::FromString(BranchToVisualize->Name)) .ToolTipText(FText::FromString(BranchToVisualize->Name)) .Margin(FMargin(6.f, 1.f)) +#if ENGINE_MAJOR_VERSION >= 5 .OverflowPolicy(ETextOverflowPolicy::Ellipsis) +#endif .Font(FontInfo) .HighlightText(HighlightText); } @@ -95,7 +101,9 @@ TSharedRef SPlasticSourceControlBranchRow::GenerateWidgetForColumn(cons .Text(FText::FromString(MoveTemp(CommentOnOneLine))) .ToolTipText(FText::FromString(BranchToVisualize->Comment)) .Margin(FMargin(6.f, 1.f)) +#if ENGINE_MAJOR_VERSION >= 5 .OverflowPolicy(ETextOverflowPolicy::Ellipsis) +#endif .Font(FontInfo) .HighlightText(HighlightText); } diff --git a/Source/PlasticSourceControl/Private/SPlasticSourceControlBranchesWidget.cpp b/Source/PlasticSourceControl/Private/SPlasticSourceControlBranchesWidget.cpp index 5e9f560d..81b98eff 100644 --- a/Source/PlasticSourceControl/Private/SPlasticSourceControlBranchesWidget.cpp +++ b/Source/PlasticSourceControl/Private/SPlasticSourceControlBranchesWidget.cpp @@ -14,6 +14,11 @@ #if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 3 #include "Misc/ComparisonUtility.h" #endif +#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1 +#include "Styling/AppStyle.h" +#else +#include "EditorStyleSet.h" +#endif #include "Widgets/Input/SSearchBox.h" #include "Widgets/Text/STextBlock.h" #include "Widgets/Views/SHeaderRow.h" @@ -36,7 +41,11 @@ void SPlasticSourceControlBranchesWidget::Construct(const FArguments& InArgs) .AutoHeight() [ SNew(SBorder) +#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1 .BorderImage(FAppStyle::GetBrush("ToolPanel.GroupBorder")) +#else + .BorderImage(FEditorStyle::GetBrush("DetailsView.CategoryBottom")) +#endif .Padding(4) [ SNew(SHorizontalBox) @@ -71,7 +80,7 @@ void SPlasticSourceControlBranchesWidget::Construct(const FArguments& InArgs) .AutoHeight() [ SNew(SBox) - .Padding(0, 3) + .Padding(FMargin(0.f, 3.f)) [ SNew(SHorizontalBox) +SHorizontalBox::Slot() @@ -104,7 +113,11 @@ void SPlasticSourceControlBranchesWidget::Construct(const FArguments& InArgs) TSharedRef SPlasticSourceControlBranchesWidget::CreateToolBar() { +#if ENGINE_MAJOR_VERSION >= 5 FSlimHorizontalToolBarBuilder ToolBarBuilder(nullptr, FMultiBoxCustomization::None); +#else + FToolBarBuilder ToolBarBuilder(nullptr, FMultiBoxCustomization::None); +#endif ToolBarBuilder.AddToolBarButton( FUIAction( @@ -112,7 +125,11 @@ TSharedRef SPlasticSourceControlBranchesWidget::CreateToolBar() NAME_None, LOCTEXT("SourceControl_RefreshButton", "Refresh"), LOCTEXT("SourceControl_RefreshButton_Tooltip", "Refreshes branches from revision control provider."), +#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1 FSlateIcon(FAppStyle::GetAppStyleSetName(), "SourceControl.Actions.Refresh")); +#else + FSlateIcon(FEditorStyle::GetStyleSetName(), "SourceControl.Actions.Refresh")); +#endif return ToolBarBuilder.MakeWidget(); }