[view] layout/skin fixes
This commit is contained in:
@@ -7,12 +7,17 @@ import haxework.view.core.HAlign;
|
||||
class DefaultLayout extends Layout {
|
||||
|
||||
override public function place(group:IGroupView, views:Array<IView<Dynamic>>):Void {
|
||||
var width:Float = 0;
|
||||
var height:Float = 0;
|
||||
for (view in views) {
|
||||
setViewWidth(group, view);
|
||||
setViewHeight(group, view);
|
||||
placeViewHorizontal(group, view);
|
||||
placeViewVertical(group, view);
|
||||
width = Math.max(width, view.width);
|
||||
height = Math.max(height, view.height);
|
||||
}
|
||||
if (!overflow) group.setContentSize(width, height, "group");
|
||||
}
|
||||
|
||||
private function filterViews(group:IGroupView, views:Array<IView<Dynamic>>):Array<IView<Dynamic>> {
|
||||
|
||||
@@ -62,7 +62,8 @@ class PopupView<R> extends GroupView {
|
||||
public function reject(reason:Dynamic):Void {
|
||||
manager.close(this);
|
||||
if (deferred != null) {
|
||||
deferred.throwError(reason);
|
||||
//deferred.throwError(reason);
|
||||
deferred.resolve(null);
|
||||
deferred = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ class GeometrySkin implements ISkin<IView<Dynamic>> {
|
||||
}
|
||||
if (updated) {
|
||||
view.toUpdate();
|
||||
view.toUpdateParent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,16 +18,17 @@ class LayoutSkin implements ISkin<IGroupView> {
|
||||
view.layout.margin = layout.margin;
|
||||
updated = true;
|
||||
}
|
||||
if (layout.hAlign != NONE && layout.hAlign != view.geometry.hAlign) {
|
||||
if (layout.hAlign != NONE && layout.hAlign != view.layout.hAlign) {
|
||||
view.layout.hAlign = layout.hAlign;
|
||||
updated = true;
|
||||
}
|
||||
if (layout.vAlign != NONE && layout.vAlign != view.geometry.vAlign) {
|
||||
if (layout.vAlign != NONE && layout.vAlign != view.layout.vAlign) {
|
||||
view.layout.vAlign = layout.vAlign;
|
||||
updated = true;
|
||||
}
|
||||
if (updated) {
|
||||
view.toUpdate();
|
||||
view.toUpdateParent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user