Files
UnrealEngineUWP/Engine/Source/Editor/ContentBrowser/Private/SSearchToggleButton.h
Steven Dao 1dd9c14c71 Move header search boxes in content browser's left-hand tree view to second line and adjust spacing
This gives them a bit more space and prevents them from being squished when the left-hand tree view is narrow

#jira UETOOL-2974
#rb louise.rasmussen
#robomerge 5.0
#preflight 6154b5c7260f7d0001fc72b9

[CL 17666514 by Steven Dao in ue5-main branch]
2021-09-29 15:55:22 -04:00

47 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Widgets/SCompoundWidget.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Styling/SlateTypes.h"
#include "Styling/AppStyle.h"
#include "Styling/SlateWidgetStyleAsset.h"
class SSearchBox;
DECLARE_DELEGATE(FOnSearchBoxShown)
class SSearchToggleButton : public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(SSearchToggleButton)
: _Style(&FAppStyle::Get().GetWidgetStyle<FSearchBoxStyle>("SearchBox"))
{}
/** Search box style (used to match the glass icon) */
SLATE_STYLE_ARGUMENT(FSearchBoxStyle, Style)
/** Event fired when the associated search box is made visible */
SLATE_EVENT(FOnSearchBoxShown, OnSearchBoxShown)
SLATE_END_ARGS()
void Construct(const FArguments& InArgs, TSharedRef<SSearchBox> SearchBox);
/** @return true if the search area is expanded and the search box exposed */
bool IsExpanded() const { return bIsExpanded; }
/** Sets whether or not the search area is expanded to expose the search box */
void SetExpanded(bool bInExpanded);
private:
ECheckBoxState GetToggleButtonState() const;
void OnToggleButtonStateChanged(ECheckBoxState CheckBoxState);
EVisibility GetSearchBoxVisibility() const;
private:
const FSearchBoxStyle* SearchStyle;
bool bIsExpanded;
FOnSearchBoxShown OnSearchBoxShown;
TWeakPtr<SSearchBox> SearchBoxPtr;
};