Layout add minWidth minHeight maxWidth maxHeight
This commit is contained in:
@@ -43,6 +43,12 @@ export interface LayoutConfig {
|
||||
alignment?: Gravity
|
||||
//Only affective in VLayout or HLayout
|
||||
weight?: number
|
||||
|
||||
maxWidth?: number
|
||||
maxHeight?: number
|
||||
|
||||
minWidth?: number
|
||||
minHeight?: number
|
||||
}
|
||||
|
||||
export class LayoutConfigImpl implements LayoutConfig, Modeling {
|
||||
@@ -58,6 +64,12 @@ export class LayoutConfigImpl implements LayoutConfig, Modeling {
|
||||
//Only affective in VLayout or HLayout
|
||||
weight?: number
|
||||
|
||||
maxWidth?: number
|
||||
maxHeight?: number
|
||||
|
||||
minWidth?: number
|
||||
minHeight?: number
|
||||
|
||||
fit() {
|
||||
this.widthSpec = LayoutSpec.FIT
|
||||
this.heightSpec = LayoutSpec.FIT
|
||||
@@ -106,6 +118,26 @@ export class LayoutConfigImpl implements LayoutConfig, Modeling {
|
||||
return this
|
||||
}
|
||||
|
||||
configMaxWidth(v: number) {
|
||||
this.maxWidth = v
|
||||
return this
|
||||
}
|
||||
|
||||
configMaxHeight(v: number) {
|
||||
this.maxHeight = v
|
||||
return this
|
||||
}
|
||||
|
||||
configMinWidth(v: number) {
|
||||
this.minWidth = v
|
||||
return this
|
||||
}
|
||||
|
||||
configMinHeight(v: number) {
|
||||
this.minHeight = v
|
||||
return this
|
||||
}
|
||||
|
||||
toModel() {
|
||||
return {
|
||||
widthSpec: this.widthSpec,
|
||||
|
Reference in New Issue
Block a user