Skip to content

Commit eadc666

Browse files
committed
default width of View should be "auto"
1 parent 4852eeb commit eadc666

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/ui/core.jsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class Util {
7171

7272

7373
static function applyGradient(style : web.CSSStyleDeclaration, type : string, begin : string, end : string, fromColor : Color, toColor : Color) : void {
74+
// TODO: portability?
7475
var s = Util.format("-webkit-gradient(%1, %2, %3, from(%4), to(%5))",
7576
[type, begin, end, fromColor.toString(), toColor.toString()]);
7677
style.background = s;
@@ -320,7 +321,7 @@ class View implements Responder, Appearance {
320321
var style = block.style;
321322

322323
style.backgroundColor = this._backgroundColor.toString();
323-
style.width = "100%";
324+
style.width = "auto";
324325

325326
if (Platform.DEBUG) {
326327
//style.border = Util.borderWithColor(Color.BLUE);
@@ -517,9 +518,8 @@ class Label extends View {
517518
var style = element.style;
518519
style.color = this._color.toString();
519520
style.textAlign = this._align;
520-
style.paddingTop = "5px";
521-
style.paddingBottom = "5px";
522-
style.margin = "2px";
521+
style.padding = "5px";
522+
style.margin = "2px";
523523

524524
style.borderRadius = "8px";
525525
Util.applyGradient(style, "linear", "left top", "left bottom", Color.WHITE, Color.LIGHT_GRAY);

0 commit comments

Comments
 (0)