[macro] add StyleMacro
This commit is contained in:
@@ -9,18 +9,16 @@ import haxework.view.geometry.SizeSet;
|
||||
import haxework.view.group.IGroupView;
|
||||
import haxework.view.skin.ISkin;
|
||||
import haxework.view.theme.ITheme;
|
||||
import haxework.view.theme.StyleId;
|
||||
|
||||
class View<C:DisplayObject> implements IView<C> {
|
||||
@:style class View<C:DisplayObject> implements IView<C> {
|
||||
|
||||
private static var counter:Int = 0;
|
||||
public static var updater(default, null):ViewUpdater = new ViewUpdater();
|
||||
|
||||
@:provide var theme:ITheme;
|
||||
|
||||
public var geometry(default, default):Geometry;
|
||||
public var skin(default, set):ISkin<Dynamic>;
|
||||
public var style(default, set):StyleId;
|
||||
@:style public var geometry(default, default):Geometry;
|
||||
@:style public var skin(default, default):ISkin<Dynamic>;
|
||||
|
||||
public var id(default, default):String;
|
||||
|
||||
@@ -56,7 +54,11 @@ class View<C:DisplayObject> implements IView<C> {
|
||||
geometry = new Geometry();
|
||||
visible = true;
|
||||
index = -1;
|
||||
skin = null;
|
||||
}
|
||||
|
||||
private function onStyle():Void {
|
||||
toUpdate();
|
||||
toRedraw();
|
||||
}
|
||||
|
||||
public function toRedraw():Void {
|
||||
@@ -118,22 +120,13 @@ class View<C:DisplayObject> implements IView<C> {
|
||||
return y;
|
||||
}
|
||||
|
||||
private function set_skin(value:ISkin<Dynamic>):ISkin<Dynamic> {
|
||||
// ToDo:
|
||||
/*private function set_skin(value:ISkin<Dynamic>):ISkin<Dynamic> {
|
||||
this.skin = value;
|
||||
toRedraw();
|
||||
return this.skin;
|
||||
}
|
||||
|
||||
private function set_style(value:StyleId):StyleId {
|
||||
if (value != null && style != value) {
|
||||
style = value;
|
||||
if (theme != null) {
|
||||
theme.bind(style, this);
|
||||
}
|
||||
}
|
||||
return style;
|
||||
}
|
||||
|
||||
*/
|
||||
private function set_visible(value:Bool):Bool {
|
||||
if (visible != value) {
|
||||
visible = value;
|
||||
|
||||
Reference in New Issue
Block a user