v0.9.2: fixed layout issues with recent styledbutton changes
This commit is contained in:
parent
4a31acf50e
commit
33e70fa89d
|
@ -119,6 +119,7 @@ public class NewsScene extends PixelScene {
|
||||||
boolean rightCol = false;
|
boolean rightCol = false;
|
||||||
for (NewsArticle article : articles) {
|
for (NewsArticle article : articles) {
|
||||||
StyledButton b = new ArticleButton(article);
|
StyledButton b = new ArticleButton(article);
|
||||||
|
b.multiline = true;
|
||||||
if (!rightCol) {
|
if (!rightCol) {
|
||||||
top += gap;
|
top += gap;
|
||||||
b.setRect( left, top, BTN_WIDTH, BTN_HEIGHT);
|
b.setRect( left, top, BTN_WIDTH, BTN_HEIGHT);
|
||||||
|
|
|
@ -35,6 +35,8 @@ public class StyledButton extends Button {
|
||||||
protected NinePatch bg;
|
protected NinePatch bg;
|
||||||
protected RenderedTextBlock text;
|
protected RenderedTextBlock text;
|
||||||
protected Image icon;
|
protected Image icon;
|
||||||
|
|
||||||
|
public boolean multiline;
|
||||||
|
|
||||||
public StyledButton(Chrome.Type type, String label ) {
|
public StyledButton(Chrome.Type type, String label ) {
|
||||||
this(type, label, 9);
|
this(type, label, 9);
|
||||||
|
@ -65,7 +67,7 @@ public class StyledButton extends Button {
|
||||||
if (icon != null) componentWidth += icon.width() + 2;
|
if (icon != null) componentWidth += icon.width() + 2;
|
||||||
|
|
||||||
if (text != null && !text.text().equals("")){
|
if (text != null && !text.text().equals("")){
|
||||||
text.maxWidth( (int)(width - componentWidth - bg.marginHor() - 2));
|
if (multiline) text.maxWidth( (int)(width - componentWidth - bg.marginHor() - 2));
|
||||||
componentWidth += text.width() + 2;
|
componentWidth += text.width() + 2;
|
||||||
|
|
||||||
text.setPos(
|
text.setPos(
|
||||||
|
|
|
@ -74,6 +74,7 @@ public class WndCombo extends Window {
|
||||||
};
|
};
|
||||||
ic.tint(move.tintColor);
|
ic.tint(move.tintColor);
|
||||||
moveBtn.icon(ic);
|
moveBtn.icon(ic);
|
||||||
|
moveBtn.multiline = true;
|
||||||
moveBtn.setSize(width, moveBtn.reqHeight());
|
moveBtn.setSize(width, moveBtn.reqHeight());
|
||||||
moveBtn.setRect(0, pos, width, moveBtn.reqHeight());
|
moveBtn.setRect(0, pos, width, moveBtn.reqHeight());
|
||||||
moveBtn.enable(combo.canUseMove(move));
|
moveBtn.enable(combo.canUseMove(move));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user