Adjust height of vehicle list items in vehicle lists

This commit is contained in:
Jonathan G Rennison
2022-12-04 22:02:26 +00:00
parent 7c882b43eb
commit c457dc680b
3 changed files with 5 additions and 4 deletions

View File

@@ -263,7 +263,7 @@ private:
this->column_size[VGC_NUMBER] = GetStringBoundingBox(STR_GROUP_COUNT_WITH_SUBGROUP);
this->tiny_step_height = std::max(this->tiny_step_height, this->column_size[VGC_NUMBER].height);
this->tiny_step_height += WidgetDimensions::scaled.framerect.Vertical() + 1;
this->tiny_step_height += WidgetDimensions::scaled.framerect.Vertical() + ScaleGUITrad(2);
return WidgetDimensions::scaled.framerect.left +
this->column_size[VGC_FOLD].width + WidgetDimensions::scaled.hsep_normal +

View File

@@ -45,6 +45,7 @@
#include "toolbar_gui.h"
#include "core/geometry_func.hpp"
#include "infrastructure_func.h"
#include "zoom_func.h"
#include "safeguards.h"
@@ -3604,7 +3605,7 @@ private:
this->column_size[VGC_NUMBER] = GetStringBoundingBox(STR_TRACE_RESTRICT_SLOT_MAX_OCCUPANCY);
this->tiny_step_height = std::max(this->tiny_step_height, this->column_size[VGC_NUMBER].height);
this->tiny_step_height += WidgetDimensions::scaled.matrix.top;
this->tiny_step_height += WidgetDimensions::scaled.matrix.top + ScaleGUITrad(1);
return WidgetDimensions::scaled.framerect.Horizontal() + WidgetDimensions::scaled.vsep_wide +
this->column_size[VGC_NAME].width + WidgetDimensions::scaled.vsep_wide +

View File

@@ -1782,9 +1782,9 @@ void DrawVehicleImage(const Vehicle *v, const Rect &r, VehicleID selection, Engi
uint GetVehicleListHeight(VehicleType type, uint divisor)
{
/* Name + vehicle + profit */
uint base = ScaleGUITrad(GetVehicleHeight(type)) + 2 * FONT_HEIGHT_SMALL;
uint base = ScaleGUITrad(GetVehicleHeight(type)) + 2 * FONT_HEIGHT_SMALL + ScaleGUITrad(1);
/* Drawing of the 4 small orders + profit*/
if (type >= VEH_SHIP) base = std::max(base, 5U * FONT_HEIGHT_SMALL);
if (type >= VEH_SHIP) base = std::max(base, 5U * FONT_HEIGHT_SMALL + ScaleGUITrad(1));
if (divisor == 1) return base;