package com.imyeyu.fx.ui.examples.view.pages.component;

import com.imyeyu.fx.ui.TimiFXUI;
import com.imyeyu.fx.ui.components.TitleLabel;
import com.imyeyu.fx.ui.examples.component.AbstractDemoPane;
import com.imyeyu.fx.ui.examples.component.sidebar.SidebarItem;
import com.imyeyu.inject.annotation.Component;
import javafx.geometry.Insets;
import javafx.scene.layout.VBox;

/**
 * 标题标签
 *
 * @author 夜雨
 * @since 2022-09-06 23:57
 */
@Component
public class TitleLabelDemo extends AbstractDemoPane {

	public TitleLabelDemo() {
		title.setText(SidebarItem.TITLE_LABEL.getText());
		document.sync("https://doc.imyeyu.net/timi-fx/net/imyeyu/timifx/component/TitleLabel.html");
		source.sync("https://git.imyeyu.net/Timi/timi-fx/src/master/src/main/java/net/imyeyu/timifx/component/TitleLabel.java");

		// 默认
		TitleLabel t0 = new TitleLabel(TimiFXUI.MULTILINGUAL.text("title"));

		// 自定义颜色
		TitleLabel t1 = new TitleLabel(TimiFXUI.MULTILINGUAL.text("fx.example.title_label.color"));
		t1.setLineColor(Colorful.PINK);

		// 自定义间距
		TitleLabel t2 = new TitleLabel(TimiFXUI.MULTILINGUAL.text("fx.example.title_label.spacing"));
		t2.setSpacing(32);
		t2.setLineColor(Colorful.BLUE);

		setCenter(new VBox() {{
			setSpacing(32);
			setPadding(new Insets(20));
			getChildren().addAll(t0, t1, t2);
		}});
	}
}
