| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d2571e1 commit 19b03bb
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -91,10 +91,13 @@ export function test_setting_minHeight_property_from_CSS_is_applied_to_Style() { | |||
| 91 | 91 | } | |
| 92 | 92 | ||
| 93 | 93 | export function test_setting_verticalAlignment_property_from_CSS_is_applied_to_Style() { | |
| 94 | - | ||
| 95 | 94 | test_property_from_CSS_is_applied_to_style("verticalAlignment", "vertical-align", "bottom"); | |
| 96 | 95 | } | |
| 97 | 96 | ||
| 97 | + export function test_setting_verticalAlignment_middle_is_applied_to_Style() { | ||
| 98 | + test_property_from_CSS_is_applied_to_style("verticalAlignment", "vertical-align", "middle"); | ||
| 99 | + } | ||
| 100 | + | ||
| 98 | 101 | export function test_setting_horizontalAlignment_property_from_CSS_is_applied_to_Style() { | |
| 99 | 102 | test_property_from_CSS_is_applied_to_style("horizontalAlignment", "horizontal-align", "right"); | |
| 100 | 103 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -717,7 +717,7 @@ export class View extends proxy.ProxyObject implements definition.View { | |||
| 717 | 717 | childTop = top + child.marginTop * density; | |
| 718 | 718 | break; | |
| 719 | 719 | ||
| 720 | - case enums.VerticalAlignment.center: | ||
| 720 | + case enums.VerticalAlignment.center || enums.VerticalAlignment.middle: | ||
| 721 | 721 | childTop = top + (bottom - top - childHeight + (child.marginTop - child.marginBottom) * density) / 2; | |
| 722 | 722 | break; | |
| 723 | 723 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -161,6 +161,11 @@ | |||
| 161 | 161 | */ | |
| 162 | 162 | export var center: string; | |
| 163 | 163 | ||
| 164 | + /** | ||
| 165 | + * Same as center. An element should be aligned in the middle. | ||
| 166 | + */ | ||
| 167 | + export var middle: string; | ||
| 168 | + | ||
| 164 | 169 | /** | |
| 165 | 170 | * An element should be bottom aligned. | |
| 166 | 171 | */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,6 +41,7 @@ export module HorizontalAlignment { | |||
| 41 | 41 | export module VerticalAlignment { | |
| 42 | 42 | export var top = "top"; | |
| 43 | 43 | export var center = "center"; | |
| 44 | + export var middle = "middle"; | ||
| 44 | 45 | export var bottom = "bottom"; | |
| 45 | 46 | export var stretch = "stretch"; | |
| 46 | 47 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -114,7 +114,7 @@ export class StackLayout extends common.StackLayout { | |||
| 114 | 114 | var childRight = right - left - paddingRight; | |
| 115 | 115 | ||
| 116 | 116 | switch (this.verticalAlignment) { | |
| 117 | - case enums.VerticalAlignment.center: | ||
| 117 | + case enums.VerticalAlignment.center || enums.VerticalAlignment.middle: | ||
| 118 | 118 | childTop = (bottom - top - this._totalLength) / 2 + paddingTop - paddingBottom; | |
| 119 | 119 | break; | |
| 120 | 120 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -175,7 +175,7 @@ export class DefaultStyler implements definition.stylers.Styler { | |||
| 175 | 175 | gravity |= android.view.Gravity.TOP; | |
| 176 | 176 | break; | |
| 177 | 177 | ||
| 178 | - case enums.VerticalAlignment.center: | ||
| 178 | + case enums.VerticalAlignment.center || enums.VerticalAlignment.middle: | ||
| 179 | 179 | gravity |= android.view.Gravity.CENTER_VERTICAL; | |
| 180 | 180 | break; | |
| 181 | 181 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments