// Fill out your copyright notice in the Description page of Project Settings.


#include "Widget/ConfigItemWidget.h"



void SConfigItemWidget::Construct(const FArguments& InArgs)
{
	InputText = InArgs._DefaultText.ToString();
	ChildSlot[
		SNew(SHorizontalBox)
		+ SHorizontalBox::Slot()
			.AutoWidth()
			.Padding(10, 0)
			[
				SNew(STextBlock)
				.Text(InArgs._Title)
			]
		+ SHorizontalBox::Slot()
			.FillWidth(1.0f)
			.Padding(10, 0)
			[
				SNew(SEditableTextBox)
				.HintText( InArgs._HintText)
				.Text_Lambda([this, InArgs]() {
					return FText::FromString(InputText); 
				})
				.OnTextCommitted_Lambda([this](const FText& Text, ETextCommit::Type){
					InputText = Text.ToString();
				})
			]
	];
}



