package view;

import feathers.layout.Measurements;
import feathers.skins.RectangleSkin;
import components.ToolBarToggleButton.ToolbarToggleButton;
import feathers.controls.LayoutGroup;
import feathers.events.FeathersEvent;
import feathers.layout.HorizontalDistributedLayout;
import model.Constants;
import openfl.Assets;
import t9.util.ColorTraces.*;

class MainFooter extends LayoutGroup {

  private var btn1:ToolbarToggleButton;
  private var btn2:ToolbarToggleButton;

	public function new() {
		super();

		addEventListener(FeathersEvent.CREATION_COMPLETE, onCreationComplete);
	}

	override private function initialize():Void {
		super.initialize();

		backgroundSkin = new RectangleSkin(SolidColor(Constants.MAIN_COLOR3, 1));
		//variant = LayoutGroup.VARIANT_TOOL_BAR;

		// Layout
		var hdl:HorizontalDistributedLayout = new HorizontalDistributedLayout();
		layout = hdl;

		// Buttons
		btn1 = new ToolbarToggleButton(Assets.getText("vector/rider_icon_black.svg"), 
									   Constants.MAIN_COLOR2, 
									   Constants.HERO_COLOR,
									   30,
									   14);
		btn1.text = Constants.MENU_ITEM_0_STRING;
    	addChild(btn1);

    	btn2 = new ToolbarToggleButton(Assets.getText("vector/certificate_icon_black.svg"), 
									   Constants.MAIN_COLOR2, 
									   Constants.HERO_COLOR,
									   30,
									   14);
		btn2.text  = Constants.MENU_ITEM_1_STRING;
    	addChild(btn2);

	}

	private function onCreationComplete(event:FeathersEvent):Void {
		traceBlue(this + " --> onCreationComplete() - w: " + width + " h: " + height );
	}
}
