burger menu try
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@@ -31,5 +31,6 @@
|
||||
|
||||
<!-- copies data/Employees.xml to output -->
|
||||
<assets path="assets/data" rename="data" embed="false"/>
|
||||
<assets path="assets/bitmaps" rename="bitmaps" embed="false"/>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,24 @@
|
||||
package components;
|
||||
|
||||
import openfl.display.Bitmap;
|
||||
import openfl.display.BitmapData;
|
||||
import feathers.controls.Button;
|
||||
import t9.util.ColorTraces.*;
|
||||
|
||||
class NekoIconButton extends Button{
|
||||
|
||||
private var bmp:Bitmap;
|
||||
|
||||
public function new(pSkin:BitmapData, pX:Int = 0, pY:Int = 0, pWidth:Int = 100, pHeight:Int = 100) {
|
||||
|
||||
super();
|
||||
|
||||
bmp = new Bitmap(pSkin);
|
||||
backgroundSkin = bmp;
|
||||
bmp.width = pWidth;
|
||||
bmp.height = pHeight;
|
||||
bmp.smoothing = true;
|
||||
traceYellow(pWidth + " / " + pHeight);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package view;
|
||||
|
||||
import components.NekoIconButton;
|
||||
import openfl.display.Bitmap;
|
||||
import feathers.events.TriggerEvent;
|
||||
import feathers.controls.Button;
|
||||
import feathers.layout.HorizontalLayout;
|
||||
@@ -20,7 +22,7 @@ import t9.util.ColorTraces.*;
|
||||
class MainHeader extends LayoutGroup {
|
||||
|
||||
private var lb1:Label;
|
||||
private var dBtn:Button;
|
||||
private var drawerBtn:NekoIconButton;
|
||||
|
||||
public function new() {
|
||||
super();
|
||||
@@ -51,9 +53,9 @@ class MainHeader extends LayoutGroup {
|
||||
layout = l;
|
||||
|
||||
// Drawer button
|
||||
dBtn = new Button("menu");
|
||||
dBtn.addEventListener(TriggerEvent.TRIGGER, onDBtnPress);
|
||||
addChild(dBtn);
|
||||
drawerBtn = new NekoIconButton(Assets.getBitmapData("bitmaps/menu_white.png"), 0, 0, Std.int(headerHeight), Std.int(headerHeight));
|
||||
drawerBtn.addEventListener(TriggerEvent.TRIGGER, onDBtnPress);
|
||||
addChild(drawerBtn);
|
||||
|
||||
|
||||
// Title label
|
||||
@@ -66,7 +68,7 @@ class MainHeader extends LayoutGroup {
|
||||
var fnt:Font = Assets.getFont(Constants.MONTSERRAT_MEDIUM_500);
|
||||
|
||||
lb1.textFormat = new TextFormat(fnt.fontName, Std.int(headerHeight * .4), Constants.MAIN_COLOR3);
|
||||
addChild(lb1);
|
||||
//addChild(lb1);
|
||||
}
|
||||
|
||||
private function onCreationComplete(event:FeathersEvent):Void {
|
||||
|
||||
Reference in New Issue
Block a user