Mercurial > hg > openttd
comparison src/network/network_gui.cpp @ 13879:1501e8e0b705 draft
(svn r18408) -Fix (r17954): After computing the needed width for the client list, also use it.
author | frosch <frosch@openttd.org> |
---|---|
date | Sat, 05 Dec 2009 13:53:58 +0000 |
parents | d603390e5833 |
children | 1017887e1560 |
comparison
equal
deleted
inserted
replaced
13878:2e31d7cf0578 | 13879:1501e8e0b705 |
---|---|
2028 if (widget != CLW_PANEL) return; | 2028 if (widget != CLW_PANEL) return; |
2029 | 2029 |
2030 this->server_client_width = max(GetStringBoundingBox(STR_NETWORK_SERVER).width, GetStringBoundingBox(STR_NETWORK_CLIENT).width) + WD_FRAMERECT_RIGHT; | 2030 this->server_client_width = max(GetStringBoundingBox(STR_NETWORK_SERVER).width, GetStringBoundingBox(STR_NETWORK_CLIENT).width) + WD_FRAMERECT_RIGHT; |
2031 this->company_icon_width = GetSpriteSize(SPR_COMPANY_ICON).width + WD_FRAMERECT_LEFT; | 2031 this->company_icon_width = GetSpriteSize(SPR_COMPANY_ICON).width + WD_FRAMERECT_LEFT; |
2032 | 2032 |
2033 uint width = 200; // Default width | 2033 uint width = 100; // Default width |
2034 const NetworkClientInfo *ci; | 2034 const NetworkClientInfo *ci; |
2035 FOR_ALL_CLIENT_INFOS(ci) { | 2035 FOR_ALL_CLIENT_INFOS(ci) { |
2036 width = max(width, GetStringBoundingBox(ci->client_name).width); | 2036 width = max(width, GetStringBoundingBox(ci->client_name).width); |
2037 } | 2037 } |
2038 | 2038 |
2039 size->width = WD_FRAMERECT_LEFT + this->server_client_width + this->company_icon_width + WD_FRAMERECT_RIGHT; | 2039 size->width = WD_FRAMERECT_LEFT + this->server_client_width + this->company_icon_width + width + WD_FRAMERECT_RIGHT; |
2040 } | 2040 } |
2041 | 2041 |
2042 virtual void OnPaint() | 2042 virtual void OnPaint() |
2043 { | 2043 { |
2044 /* Check if we need to reset the height */ | 2044 /* Check if we need to reset the height */ |