Layout add minWidth minHeight maxWidth maxHeight

This commit is contained in:
pengfei.zhou
2020-04-11 12:20:43 +08:00
committed by osborn
parent 4e537eed47
commit 80811a3bf6
15 changed files with 228 additions and 112 deletions

View File

@@ -25,6 +25,10 @@ export interface LayoutConfig {
};
alignment?: Gravity;
weight?: number;
maxWidth?: number;
maxHeight?: number;
minWidth?: number;
minHeight?: number;
}
export declare class LayoutConfigImpl implements LayoutConfig, Modeling {
widthSpec?: LayoutSpec;
@@ -37,6 +41,10 @@ export declare class LayoutConfigImpl implements LayoutConfig, Modeling {
};
alignment?: Gravity;
weight?: number;
maxWidth?: number;
maxHeight?: number;
minWidth?: number;
minHeight?: number;
fit(): this;
most(): this;
just(): this;
@@ -50,6 +58,10 @@ export declare class LayoutConfigImpl implements LayoutConfig, Modeling {
}): this;
configAlignment(a: Gravity): this;
configWeight(w: number): this;
configMaxWidth(v: number): this;
configMaxHeight(v: number): this;
configMinWidth(v: number): this;
configMinHeight(v: number): this;
toModel(): {
widthSpec: LayoutSpec | undefined;
heightSpec: LayoutSpec | undefined;

View File

@@ -49,6 +49,22 @@ export class LayoutConfigImpl {
this.weight = w;
return this;
}
configMaxWidth(v) {
this.maxWidth = v;
return this;
}
configMaxHeight(v) {
this.maxHeight = v;
return this;
}
configMinWidth(v) {
this.minWidth = v;
return this;
}
configMinHeight(v) {
this.minHeight = v;
return this;
}
toModel() {
return {
widthSpec: this.widthSpec,