Changeset - r19617:6c19a5239832
[Not reviewed]
master
0 1 0
alberth - 12 years ago 2012-09-22 19:14:06
alberth@openttd.org
(svn r24548) -Add: Extra group line in the group gui, if possible (Juanjo).
1 file changed with 2 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/group_gui.cpp
Show inline comments
 
@@ -333,29 +333,26 @@ public:
 
				resize->height = this->tiny_step_height;
 

	
 
				/* Minimum height is the height of the list widget minus all and default vehicles... */
 
				size->height =  4 * GetVehicleListHeight(this->vli.vtype, this->tiny_step_height) - 2 * this->tiny_step_height;
 

	
 
				/* ... minus the buttons at the bottom ... */
 
				uint max_icon_height = 25;
 
				max_icon_height = max(max_icon_height, GetSpriteSize(this->GetWidget<NWidgetCore>(WID_GL_CREATE_GROUP)->widget_data).height);
 
				max_icon_height = max(max_icon_height, GetSpriteSize(this->GetWidget<NWidgetCore>(WID_GL_RENAME_GROUP)->widget_data).height);
 
				max_icon_height = max(max_icon_height, GetSpriteSize(this->GetWidget<NWidgetCore>(WID_GL_DELETE_GROUP)->widget_data).height);
 
				max_icon_height = max(max_icon_height, GetSpriteSize(this->GetWidget<NWidgetCore>(WID_GL_REPLACE_PROTECTION)->widget_data).height);
 

	
 
				/* ... plus the statusbar below the vehicle list */
 
				if (max_icon_height > FONT_HEIGHT_NORMAL) max_icon_height -= FONT_HEIGHT_NORMAL;
 

	
 
				/* The size must be a multiple of tiny_step_height for the resizing to work */
 
				size->height -= this->tiny_step_height * CeilDiv(max_icon_height, this->tiny_step_height);
 
				/* Get a multiple of tiny_step_height of that amount */
 
				size->height = Ceil(size->height - max_icon_height, tiny_step_height);
 
				break;
 
			}
 

	
 
			case WID_GL_ALL_VEHICLES:
 
			case WID_GL_DEFAULT_VEHICLES:
 
				size->width = this->ComputeGroupInfoSize();
 
				size->height = this->tiny_step_height;
 
				break;
 

	
 
			case WID_GL_SORT_BY_ORDER: {
 
				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.
0 comments (0 inline, 0 general)