Drawer related refactoring :
- removed NekoDrawerEvent Button related refactoring : - removed NekoIconButton
This commit is contained in:
+17
-22
@@ -1,10 +1,10 @@
|
||||
package view;
|
||||
|
||||
import control.AppController;
|
||||
import com.adobe.cairngorm.control.CairngormEvent;
|
||||
import com.adobe.cairngorm.control.CairngormEventDispatcher;
|
||||
import control.NekoDrawerEvent;
|
||||
import components.NekoDrawer;
|
||||
import components.NekoIconButton;
|
||||
import components.NekoRectangle;
|
||||
import feathers.controls.Button;
|
||||
import feathers.controls.Label;
|
||||
import feathers.controls.LayoutGroup;
|
||||
import feathers.events.FeathersEvent;
|
||||
@@ -18,8 +18,8 @@ import t9.util.ColorTraces.*;
|
||||
|
||||
class MainHeader extends LayoutGroup {
|
||||
|
||||
private var lb1:Label;
|
||||
private var drawerBtn:NekoIconButton;
|
||||
private var btn1:Button;
|
||||
private var lbl1:Label;
|
||||
|
||||
public function new() {
|
||||
super();
|
||||
@@ -50,26 +50,21 @@ class MainHeader extends LayoutGroup {
|
||||
l.verticalAlign = MIDDLE;
|
||||
layout = l;
|
||||
|
||||
// Drawer button
|
||||
drawerBtn = new NekoIconButton(Assets.getText("vector/menu_icon_black.svg"),
|
||||
Std.int(headerHeight * .5),
|
||||
Std.int(headerHeight * .5),
|
||||
Constants.BUTTON_INVERTED_NORMAL_STATE_COLOR);
|
||||
drawerBtn.addEventListener(TriggerEvent.TRIGGER, onDBtnPress);
|
||||
addChild(drawerBtn);
|
||||
|
||||
|
||||
// Menu button
|
||||
btn1 = new Button("menu", onMenuButtonPress);
|
||||
addChild(btn1);
|
||||
|
||||
// Title label
|
||||
lb1 = new Label();
|
||||
lbl1 = new Label();
|
||||
//lb1.backgroundSkin = new NekoRectangle(Constants.ACCENT_COLOR2);
|
||||
|
||||
//lb1.verticalAlign = VerticalAlign.TOP;
|
||||
lb1.text = Constants.MENU_ITEM_0_STRING;
|
||||
lb1.embedFonts = true;
|
||||
lbl1.text = Constants.MENU_ITEM_0_STRING;
|
||||
lbl1.embedFonts = true;
|
||||
var fnt:Font = Assets.getFont(Constants.MONTSERRAT_MEDIUM_500);
|
||||
|
||||
lb1.textFormat = new TextFormat(fnt.fontName, Std.int(headerHeight * .4), Constants.MAIN_COLOR3);
|
||||
addChild(lb1);
|
||||
lbl1.textFormat = new TextFormat(fnt.fontName, Std.int(headerHeight * .4), Constants.MAIN_COLOR3);
|
||||
addChild(lbl1);
|
||||
}
|
||||
|
||||
private function onCreationComplete(event:FeathersEvent):Void {
|
||||
@@ -77,8 +72,8 @@ class MainHeader extends LayoutGroup {
|
||||
}
|
||||
|
||||
|
||||
function onDBtnPress(e:TriggerEvent):Void {
|
||||
var ce:NekoDrawerEvent = new NekoDrawerEvent(NekoDrawer.OPEN);
|
||||
CairngormEventDispatcher.getInstance().dispatchEvent(ce);
|
||||
function onMenuButtonPress(e:TriggerEvent):Void {
|
||||
var e:CairngormEvent = new CairngormEvent(AppController.OPEN_DRAWER_EVENT);
|
||||
CairngormEventDispatcher.getInstance().dispatchEvent(e);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user