(svn r22344) -Codechange: Remove width constant from the sign list window.

This commit is contained in:
terkhen 2011-04-17 18:43:17 +00:00
parent a88fe7c2aa
commit 97ceef7663
2 changed files with 4 additions and 5 deletions

View File

@ -289,8 +289,8 @@ struct SignListWindow : QueryStringBaseWindow, SignList {
case SLW_LIST: {
Dimension spr_dim = GetSpriteSize(SPR_COMPANY_ICON);
this->text_offset = WD_FRAMETEXT_LEFT + spr_dim.width + 2; // 2 pixels space between icon and the sign text.
resize->height = max<uint>(FONT_HEIGHT_NORMAL, GetSpriteSize(SPR_COMPANY_ICON).height);
Dimension d = {this->text_offset + MAX_LENGTH_SIGN_NAME_PIXELS + WD_FRAMETEXT_RIGHT, WD_FRAMERECT_TOP + 5 * resize->height + WD_FRAMERECT_BOTTOM};
resize->height = max<uint>(FONT_HEIGHT_NORMAL, spr_dim.height);
Dimension d = {this->text_offset + WD_FRAMETEXT_RIGHT, WD_FRAMERECT_TOP + 5 * resize->height + WD_FRAMERECT_BOTTOM};
*size = maxdim(*size, d);
break;
}
@ -403,7 +403,7 @@ static const NWidgetPart _nested_sign_list_widgets[] = {
EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(NWID_VERTICAL),
NWidget(WWT_PANEL, COLOUR_GREY, SLW_LIST), SetMinimalSize(WD_FRAMETEXT_LEFT + 16 + MAX_LENGTH_SIGN_NAME_PIXELS + WD_FRAMETEXT_RIGHT, 50),
NWidget(WWT_PANEL, COLOUR_GREY, SLW_LIST), SetMinimalSize(WD_FRAMETEXT_LEFT + 16 + 255 + WD_FRAMETEXT_RIGHT, 50),
SetResize(1, 10), SetFill(1, 0), SetScrollbar(SLW_SCROLLBAR), EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_PANEL, COLOUR_GREY), SetFill(1, 1),

View File

@ -17,7 +17,6 @@ struct Sign;
static const SignID INVALID_SIGN = 0xFFFF;
static const uint MAX_LENGTH_SIGN_NAME_CHARS = 32; ///< The maximum length of a sign name in characters including '\0'
static const uint MAX_LENGTH_SIGN_NAME_PIXELS = 255; ///< The maximum length of a sign name in pixels
static const uint MAX_LENGTH_SIGN_NAME_CHARS = 32; ///< The maximum length of a sign name in characters including '\0'
#endif /* SIGNS_TYPE_H */