Some layout fixes. These buttons are still really ugly, alas.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@264 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Michael Bayne
2007-06-14 21:45:42 +00:00
parent 767a82128e
commit 300d14c438
@@ -53,31 +53,23 @@ public class SimpleTextButton extends SimpleButton
label.text = text;
label.textColor = foreground;
label.autoSize = TextFieldAutoSize.LEFT;
face.addChild(label);
var w :Number = label.textWidth + 2 * padding;
var h :Number = label.textHeight + 2 * padding;
var w :Number = label.width + 2 * padding;
var h :Number = label.height + 2 * padding;
// create our button background (and outline)
var button :Shape = new Shape();
button.graphics.beginFill(background);
// draw our button background (and outline)
face.graphics.beginFill(background);
face.graphics.lineStyle(1, foreground);
if (rounded) {
button.graphics.drawRoundRect(0, 0, w, h, padding, padding);
face.graphics.drawRoundRect(0, 0, w, h, padding, padding);
} else {
button.graphics.drawRect(0, 0, w, h);
face.graphics.drawRect(0, 0, w, h);
}
button.graphics.endFill();
button.graphics.lineStyle(1, foreground);
if (rounded) {
button.graphics.drawRoundRect(0, 0, w, h, padding, padding);
} else {
button.graphics.drawRect(0, 0, w, h);
}
face.addChild(button);
face.graphics.endFill();
label.x = padding;
label.y = padding;
face.addChild(label);
return face;
}