mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-02 09:40:35 +00:00
(svn r18408) -Fix (r17954): After computing the needed width for the client list, also use it.
This commit is contained in:
parent
0406d7176a
commit
a23b215b5a
@ -2030,13 +2030,13 @@ struct NetworkClientListWindow : Window {
|
|||||||
this->server_client_width = max(GetStringBoundingBox(STR_NETWORK_SERVER).width, GetStringBoundingBox(STR_NETWORK_CLIENT).width) + WD_FRAMERECT_RIGHT;
|
this->server_client_width = max(GetStringBoundingBox(STR_NETWORK_SERVER).width, GetStringBoundingBox(STR_NETWORK_CLIENT).width) + WD_FRAMERECT_RIGHT;
|
||||||
this->company_icon_width = GetSpriteSize(SPR_COMPANY_ICON).width + WD_FRAMERECT_LEFT;
|
this->company_icon_width = GetSpriteSize(SPR_COMPANY_ICON).width + WD_FRAMERECT_LEFT;
|
||||||
|
|
||||||
uint width = 200; // Default width
|
uint width = 100; // Default width
|
||||||
const NetworkClientInfo *ci;
|
const NetworkClientInfo *ci;
|
||||||
FOR_ALL_CLIENT_INFOS(ci) {
|
FOR_ALL_CLIENT_INFOS(ci) {
|
||||||
width = max(width, GetStringBoundingBox(ci->client_name).width);
|
width = max(width, GetStringBoundingBox(ci->client_name).width);
|
||||||
}
|
}
|
||||||
|
|
||||||
size->width = WD_FRAMERECT_LEFT + this->server_client_width + this->company_icon_width + WD_FRAMERECT_RIGHT;
|
size->width = WD_FRAMERECT_LEFT + this->server_client_width + this->company_icon_width + width + WD_FRAMERECT_RIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnPaint()
|
virtual void OnPaint()
|
||||||
|
Loading…
Reference in New Issue
Block a user