v0.8.2c: WndTitledMessage now grows in length just like WndInfoItem
This commit is contained in:
parent
65f30cfcbf
commit
d6f73bc3fa
|
@ -29,8 +29,8 @@ import com.watabou.noosa.ui.Component;
|
|||
|
||||
public class WndTitledMessage extends Window {
|
||||
|
||||
protected static final int WIDTH_P = 120;
|
||||
protected static final int WIDTH_L = 160;
|
||||
protected static final int WIDTH_MIN = 120;
|
||||
protected static final int WIDTH_MAX = 220;
|
||||
protected static final int GAP = 2;
|
||||
|
||||
public WndTitledMessage( Image icon, String title, String message ) {
|
||||
|
@ -43,7 +43,7 @@ public class WndTitledMessage extends Window {
|
|||
|
||||
super();
|
||||
|
||||
int width = PixelScene.landscape() ? WIDTH_L : WIDTH_P;
|
||||
int width = WIDTH_MIN;
|
||||
|
||||
titlebar.setRect( 0, 0, width, 0 );
|
||||
add(titlebar);
|
||||
|
@ -53,6 +53,13 @@ public class WndTitledMessage extends Window {
|
|||
text.setPos( titlebar.left(), titlebar.bottom() + 2*GAP );
|
||||
add( text );
|
||||
|
||||
while (PixelScene.landscape()
|
||||
&& text.bottom() > (PixelScene.MIN_HEIGHT_L - 10)
|
||||
&& width < WIDTH_MAX){
|
||||
width += 20;
|
||||
text.maxWidth(width);
|
||||
}
|
||||
|
||||
resize( width, (int)text.bottom() + 2 );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user