NekoRectangle removal and replaced by RectangleSkin FeathersUI native class
This commit is contained in:
@@ -1,46 +0,0 @@
|
|||||||
package components;
|
|
||||||
|
|
||||||
import feathers.controls.ButtonState;
|
|
||||||
import openfl.text.TextFormat;
|
|
||||||
import model.Constants;
|
|
||||||
import openfl.utils.Assets;
|
|
||||||
import openfl.text.Font;
|
|
||||||
import openfl.geom.ColorTransform;
|
|
||||||
import openfl.display.Shape;
|
|
||||||
import format.SVG;
|
|
||||||
import feathers.controls.Button;
|
|
||||||
|
|
||||||
class CustomButton extends Button {
|
|
||||||
|
|
||||||
private var svgIconPath:String;
|
|
||||||
private var svgIcon:Shape;
|
|
||||||
private var upStateColor:Int;
|
|
||||||
|
|
||||||
public function new(pSvgIconPath:String = null, pUpstateColor:Int = 0x000000) {
|
|
||||||
super();
|
|
||||||
|
|
||||||
svgIconPath = pSvgIconPath;
|
|
||||||
upStateColor = pUpstateColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
override private function initialize():Void {
|
|
||||||
super.initialize();
|
|
||||||
|
|
||||||
//iconPosition = TOP;
|
|
||||||
embedFonts = true;
|
|
||||||
backgroundSkin = new NekoRectangle(upStateColor);
|
|
||||||
backgroundSkin.alpha = 0;
|
|
||||||
|
|
||||||
var fnt:Font = Assets.getFont(Constants.MONTSERRAT_LIGHT_300);
|
|
||||||
textFormat = new TextFormat(fnt.fontName, 20, Constants.BUTTON_UP_COLOR);
|
|
||||||
|
|
||||||
svgIcon = new Shape();
|
|
||||||
var ct = new ColorTransform();
|
|
||||||
ct.color = 0xFFFFFF;
|
|
||||||
svgIcon.transform.colorTransform = ct;
|
|
||||||
new SVG(svgIconPath).render(svgIcon.graphics);
|
|
||||||
icon = svgIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package components;
|
package components;
|
||||||
|
|
||||||
|
import feathers.skins.RectangleSkin;
|
||||||
import feathers.controls.Button;
|
import feathers.controls.Button;
|
||||||
import format.SVG;
|
import format.SVG;
|
||||||
import openfl.display.Bitmap;
|
import openfl.display.Bitmap;
|
||||||
@@ -24,7 +25,8 @@ class IconButton extends Button {
|
|||||||
super.initialize();
|
super.initialize();
|
||||||
|
|
||||||
iconPosition = TOP;
|
iconPosition = TOP;
|
||||||
backgroundSkin = new Bitmap(new BitmapData(10, 10, true, 0xFF00FF));
|
//backgroundSkin = new Bitmap(new BitmapData(10, 10, true, 0xFF00FF));
|
||||||
|
backgroundSkin = new RectangleSkin(SolidColor( 0xFF0000, 0));
|
||||||
|
|
||||||
// icon
|
// icon
|
||||||
if(svgIconPath != null){
|
if(svgIconPath != null){
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
package components;
|
|
||||||
|
|
||||||
import openfl.display.Shape;
|
|
||||||
|
|
||||||
class NekoRectangle extends Shape {
|
|
||||||
public function new(pColor:Int = 0xFF0000, pX:Int = 0, pY:Int = 0, pWidth:Int = 10, pHeight:Int = 10) {
|
|
||||||
super();
|
|
||||||
|
|
||||||
graphics.beginFill(pColor);
|
|
||||||
graphics.drawRect(pX, pY, pWidth, pHeight);
|
|
||||||
graphics.endFill();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
package components;
|
package components;
|
||||||
|
|
||||||
import feathers.controls.ToggleButton;
|
import feathers.controls.ToggleButton;
|
||||||
|
import feathers.skins.RectangleSkin;
|
||||||
import feathers.text.TextFormat;
|
import feathers.text.TextFormat;
|
||||||
import format.SVG;
|
import format.SVG;
|
||||||
import model.Constants;
|
import model.Constants;
|
||||||
import openfl.display.Bitmap;
|
|
||||||
import openfl.display.BitmapData;
|
|
||||||
import openfl.display.Shape;
|
import openfl.display.Shape;
|
||||||
import openfl.events.Event;
|
import openfl.events.Event;
|
||||||
import openfl.geom.ColorTransform;
|
import openfl.geom.ColorTransform;
|
||||||
@@ -32,7 +31,7 @@ class ToolbarToggleButton extends ToggleButton {
|
|||||||
|
|
||||||
iconPosition = TOP;
|
iconPosition = TOP;
|
||||||
embedFonts = true;
|
embedFonts = true;
|
||||||
backgroundSkin = new Bitmap(new BitmapData(10, 10, true, 0xFF00FF));
|
backgroundSkin = new RectangleSkin(SolidColor( 0xFF0000, 0));
|
||||||
|
|
||||||
// icon
|
// icon
|
||||||
if(svgIconPath != null){
|
if(svgIconPath != null){
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
package view;
|
package view;
|
||||||
|
|
||||||
import components.NekoRectangle;
|
|
||||||
import model.Constants;
|
|
||||||
import feathers.events.TriggerEvent;
|
|
||||||
import feathers.controls.Button;
|
import feathers.controls.Button;
|
||||||
import feathers.layout.VerticalLayout;
|
import feathers.controls.Drawer;
|
||||||
import feathers.controls.LayoutGroup;
|
import feathers.controls.LayoutGroup;
|
||||||
import feathers.events.FeathersEvent;
|
import feathers.events.FeathersEvent;
|
||||||
|
import feathers.events.TriggerEvent;
|
||||||
|
import feathers.layout.VerticalLayout;
|
||||||
|
import feathers.skins.RectangleSkin;
|
||||||
|
import model.Constants;
|
||||||
import t9.util.ColorTraces.*;
|
import t9.util.ColorTraces.*;
|
||||||
import feathers.controls.Drawer;
|
|
||||||
|
|
||||||
class MainDrawer extends Drawer {
|
class MainDrawer extends Drawer {
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ class MainDrawer extends Drawer {
|
|||||||
});
|
});
|
||||||
d1.addChild(closeDrawerButton);
|
d1.addChild(closeDrawerButton);
|
||||||
|
|
||||||
overlaySkin = new NekoRectangle(Constants.HERO_COLOR);
|
overlaySkin = new RectangleSkin(SolidColor( Constants.HERO_COLOR, 1));
|
||||||
|
|
||||||
drawer = d1;
|
drawer = d1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package view;
|
package view;
|
||||||
|
|
||||||
|
import feathers.skins.RectangleSkin;
|
||||||
import components.ToolBarToggleButton.ToolbarToggleButton;
|
import components.ToolBarToggleButton.ToolbarToggleButton;
|
||||||
import components.NekoRectangle;
|
|
||||||
import feathers.controls.LayoutGroup;
|
import feathers.controls.LayoutGroup;
|
||||||
import feathers.events.FeathersEvent;
|
import feathers.events.FeathersEvent;
|
||||||
import feathers.layout.HorizontalDistributedLayout;
|
import feathers.layout.HorizontalDistributedLayout;
|
||||||
@@ -27,20 +27,20 @@ class MainFooter extends LayoutGroup {
|
|||||||
final footerWidth = Std.int(sw * Constants.MAIN_HEADER_WIDTH_RATIO);
|
final footerWidth = Std.int(sw * Constants.MAIN_HEADER_WIDTH_RATIO);
|
||||||
final footerHeight = Std.int(sh * Constants.MAIN_HEADER_HEIGHT_RATIO);
|
final footerHeight = Std.int(sh * Constants.MAIN_HEADER_HEIGHT_RATIO);
|
||||||
|
|
||||||
backgroundSkin = new NekoRectangle(Constants.MAIN_COLOR3);
|
backgroundSkin = backgroundSkin = new RectangleSkin(SolidColor( Constants.MAIN_COLOR3, 1));
|
||||||
// variant = LayoutGroup.VARIANT_TOOL_BAR;
|
variant = LayoutGroup.VARIANT_TOOL_BAR;
|
||||||
|
|
||||||
// Layout
|
// Layout
|
||||||
layout = new HorizontalDistributedLayout();
|
layout = new HorizontalDistributedLayout();
|
||||||
|
|
||||||
// Buttons
|
// Buttons
|
||||||
btn1 = new ToolbarToggleButton(Assets.getText("vector/rider_icon_black.svg"), Constants.MAIN_COLOR2, Constants.HERO_COLOR);
|
btn1 = new ToolbarToggleButton(Assets.getText("vector/rider_icon_black.svg"), Constants.MAIN_COLOR2, Constants.HERO_COLOR);
|
||||||
btn1.text = Constants.MENU_ITEM_0_STRING;
|
btn1.text = Constants.MENU_ITEM_0_STRING;
|
||||||
addChild(btn1);
|
addChild(btn1);
|
||||||
|
|
||||||
btn2 = new ToolbarToggleButton(Assets.getText("vector/certificate_icon_black.svg"), Constants.MAIN_COLOR2, Constants.HERO_COLOR);
|
btn2 = new ToolbarToggleButton(Assets.getText("vector/certificate_icon_black.svg"), Constants.MAIN_COLOR2, Constants.HERO_COLOR);
|
||||||
btn2.text = Constants.MENU_ITEM_1_STRING;
|
btn2.text = Constants.MENU_ITEM_1_STRING;
|
||||||
addChild(btn2);
|
addChild(btn2);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package view;
|
package view;
|
||||||
|
|
||||||
|
import feathers.skins.RectangleSkin;
|
||||||
import com.adobe.cairngorm.control.CairngormEvent;
|
import com.adobe.cairngorm.control.CairngormEvent;
|
||||||
import com.adobe.cairngorm.control.CairngormEventDispatcher;
|
import com.adobe.cairngorm.control.CairngormEventDispatcher;
|
||||||
import components.IconButton;
|
import components.IconButton;
|
||||||
import components.NekoRectangle;
|
|
||||||
import control.AppController;
|
import control.AppController;
|
||||||
import feathers.controls.Button;
|
import feathers.controls.Button;
|
||||||
import feathers.controls.Label;
|
import feathers.controls.Label;
|
||||||
@@ -37,11 +37,7 @@ class MainHeader extends LayoutGroup {
|
|||||||
final headerHeight = Std.int(sh * Constants.MAIN_HEADER_HEIGHT_RATIO);
|
final headerHeight = Std.int(sh * Constants.MAIN_HEADER_HEIGHT_RATIO);
|
||||||
|
|
||||||
autoSizeMode = CONTENT;
|
autoSizeMode = CONTENT;
|
||||||
backgroundSkin = new NekoRectangle( Constants.HERO_COLOR,
|
backgroundSkin = new RectangleSkin(SolidColor(Constants.HERO_COLOR, 1));
|
||||||
0,
|
|
||||||
0,
|
|
||||||
headerWidth,
|
|
||||||
headerHeight);
|
|
||||||
variant = LayoutGroup.VARIANT_TOOL_BAR;
|
variant = LayoutGroup.VARIANT_TOOL_BAR;
|
||||||
|
|
||||||
// Layout settings
|
// Layout settings
|
||||||
@@ -60,7 +56,7 @@ class MainHeader extends LayoutGroup {
|
|||||||
|
|
||||||
// Title label
|
// Title label
|
||||||
lbl1 = new Label();
|
lbl1 = new Label();
|
||||||
//lb1.backgroundSkin = new NekoRectangle(Constants.ACCENT_COLOR2);
|
//lb1.backgroundSkin = new RectangleSkin(SolidColor(Constants.ACCENT_COLOR2, 1));
|
||||||
|
|
||||||
//lb1.verticalAlign = VerticalAlign.TOP;
|
//lb1.verticalAlign = VerticalAlign.TOP;
|
||||||
lbl1.text = Constants.MENU_ITEM_0_STRING;
|
lbl1.text = Constants.MENU_ITEM_0_STRING;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package view;
|
package view;
|
||||||
|
|
||||||
|
import feathers.skins.RectangleSkin;
|
||||||
import feathers.events.FeathersEvent;
|
import feathers.events.FeathersEvent;
|
||||||
import model.Constants;
|
import model.Constants;
|
||||||
import components.NekoRectangle;
|
|
||||||
import feathers.controls.Panel;
|
import feathers.controls.Panel;
|
||||||
import t9.util.ColorTraces.*;
|
import t9.util.ColorTraces.*;
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ class MainPanel extends Panel {
|
|||||||
super.initialize();
|
super.initialize();
|
||||||
|
|
||||||
autoSizeMode = STAGE;
|
autoSizeMode = STAGE;
|
||||||
backgroundSkin = new NekoRectangle(Constants.MAIN_COLOR2);
|
backgroundSkin = new RectangleSkin(SolidColor(Constants.MAIN_COLOR2, 1));
|
||||||
|
|
||||||
mh = new MainHeader();
|
mh = new MainHeader();
|
||||||
header = mh;
|
header = mh;
|
||||||
|
|||||||
Reference in New Issue
Block a user