mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Move the effective* values from style to this
This commit is contained in:
@@ -39,11 +39,11 @@ export class Button extends ButtonBase {
|
||||
let result = new android.graphics.Rect();
|
||||
this._button.getBackground().getPadding(result);
|
||||
this._defaultNativePadding = result;
|
||||
|
||||
this.style.effectivePaddingTop = this._defaultNativePadding.top;
|
||||
this.style.effectivePaddingRight = this._defaultNativePadding.right;
|
||||
this.style.effectivePaddingBottom = this._defaultNativePadding.bottom;
|
||||
this.style.effectivePaddingLeft = this._defaultNativePadding.left;
|
||||
|
||||
this.effectivePaddingTop = this._defaultNativePadding.top;
|
||||
this.effectivePaddingRight = this._defaultNativePadding.right;
|
||||
this.effectivePaddingBottom = this._defaultNativePadding.bottom;
|
||||
this.effectivePaddingLeft = this._defaultNativePadding.left;
|
||||
}
|
||||
|
||||
@PseudoClassHandler("normal", "highlighted", "pressed", "active")
|
||||
|
||||
@@ -70,7 +70,7 @@ export class Button extends ButtonBase {
|
||||
set [borderTopWidthProperty.native](value: Length) {
|
||||
let inset = this.nativeView.contentEdgeInsets;
|
||||
let style = this.style;
|
||||
let top = style.effectivePaddingTop + style.effectiveBorderTopWidth;
|
||||
let top = this.effectivePaddingTop + this.effectiveBorderTopWidth;
|
||||
this.nativeView.contentEdgeInsets = { top: top, left: inset.left, bottom: inset.bottom, right: inset.right };
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ export class Button extends ButtonBase {
|
||||
set [borderRightWidthProperty.native](value: Length) {
|
||||
let inset = this.nativeView.contentEdgeInsets;
|
||||
let style = this.style;
|
||||
let right = style.effectivePaddingRight + style.effectiveBorderRightWidth;
|
||||
let right = this.effectivePaddingRight + this.effectiveBorderRightWidth;
|
||||
this.nativeView.contentEdgeInsets = { top: inset.top, left: inset.left, bottom: inset.bottom, right: right };
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ export class Button extends ButtonBase {
|
||||
set [borderBottomWidthProperty.native](value: Length) {
|
||||
let inset = this.nativeView.contentEdgeInsets;
|
||||
let style = this.style;
|
||||
let bottom = style.effectivePaddingBottom + style.effectiveBorderBottomWidth;
|
||||
let bottom = this.effectivePaddingBottom + this.effectiveBorderBottomWidth;
|
||||
this.nativeView.contentEdgeInsets = { top: inset.top, left: inset.left, bottom: bottom, right: inset.right };
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ export class Button extends ButtonBase {
|
||||
set [borderLeftWidthProperty.native](value: Length) {
|
||||
let inset = this.nativeView.contentEdgeInsets;
|
||||
let style = this.style;
|
||||
let left = style.effectivePaddingLeft + style.effectiveBorderLeftWidth;
|
||||
let left = this.effectivePaddingLeft + this.effectiveBorderLeftWidth;
|
||||
this.nativeView.contentEdgeInsets = { top: inset.top, left: left, bottom: inset.bottom, right: inset.right };
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ export class Button extends ButtonBase {
|
||||
set [paddingTopProperty.native](value: Length) {
|
||||
let inset = this.nativeView.contentEdgeInsets;
|
||||
let style = this.style;
|
||||
let top = style.effectivePaddingTop + style.effectiveBorderTopWidth;
|
||||
let top = this.effectivePaddingTop + this.effectiveBorderTopWidth;
|
||||
this.nativeView.contentEdgeInsets = { top: top, left: inset.left, bottom: inset.bottom, right: inset.right };
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ export class Button extends ButtonBase {
|
||||
set [paddingRightProperty.native](value: Length) {
|
||||
let inset = this.nativeView.contentEdgeInsets;
|
||||
let style = this.style;
|
||||
let right = style.effectivePaddingRight + style.effectiveBorderRightWidth;
|
||||
let right = this.effectivePaddingRight + this.effectiveBorderRightWidth;
|
||||
this.nativeView.contentEdgeInsets = { top: inset.top, left: inset.left, bottom: inset.bottom, right: right };
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ export class Button extends ButtonBase {
|
||||
set [paddingBottomProperty.native](value: Length) {
|
||||
let inset = this.nativeView.contentEdgeInsets;
|
||||
let style = this.style;
|
||||
let bottom = style.effectivePaddingBottom + style.effectiveBorderBottomWidth;
|
||||
let bottom = this.effectivePaddingBottom + this.effectiveBorderBottomWidth;
|
||||
this.nativeView.contentEdgeInsets = { top: inset.top, left: inset.left, bottom: bottom, right: inset.right };
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ export class Button extends ButtonBase {
|
||||
set [paddingLeftProperty.native](value: Length) {
|
||||
let inset = this.nativeView.contentEdgeInsets;
|
||||
let style = this.style;
|
||||
let left = style.effectivePaddingLeft + style.effectiveBorderLeftWidth;
|
||||
let left = this.effectivePaddingLeft + this.effectiveBorderLeftWidth;
|
||||
this.nativeView.contentEdgeInsets = { top: inset.top, left: left, bottom: inset.bottom, right: inset.right };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user