(svn r21151) -Fix [FS#4221]: Sort arrow wasn't accounted for in two windows causing it to be overwritten by the "sort by" string

This commit is contained in:
rubidium
2010-11-12 16:29:09 +00:00
parent 671158acd8
commit 0fc5206a5b
2 changed files with 18 additions and 0 deletions

View File

@@ -28,6 +28,7 @@
#include "widgets/dropdown_func.h"
#include "engine_gui.h"
#include "cargotype.h"
#include "core/geometry_func.hpp"
#include "table/strings.h"
@@ -1261,6 +1262,14 @@ struct BuildVehicleWindow : Window {
case BUILD_VEHICLE_WIDGET_PANEL:
size->height = this->details_height;
break;
case BUILD_VEHICLE_WIDGET_SORT_ASSENDING_DESCENDING: {
Dimension d = GetStringBoundingBox(this->GetWidget<NWidgetCore>(widget)->widget_data);
d.width += padding.width + WD_SORTBUTTON_ARROW_WIDTH * 2; // Doubled since the string is centred and it also looks better.
d.height += padding.height;
*size = maxdim(*size, d);
break;
}
}
}