File diff r27883:ddbd33508a8a → r27884:803962be0328
src/news_gui.cpp
Show inline comments
 
@@ -1125,25 +1125,25 @@ struct MessageHistoryWindow : Window {
 
		this->FinishInitNested(); // Initializes 'this->line_height' and 'this->date_width'.
 
		this->OnInvalidateData(0);
 
	}
 

	
 
	void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
 
	{
 
		if (widget == WID_MH_BACKGROUND) {
 
			this->line_height = FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal;
 
			resize->height = this->line_height;
 

	
 
			/* Months are off-by-one, so it's actually 8. Not using
 
			 * month 12 because the 1 is usually less wide. */
 
			SetDParam(0, TimerGameCalendar::ConvertYMDToDate(ORIGINAL_MAX_YEAR, 7, 30));
 
			SetDParam(0, TimerGameCalendar::ConvertYMDToDate(CalendarTime::ORIGINAL_MAX_YEAR, 7, 30));
 
			this->date_width = GetStringBoundingBox(STR_JUST_DATE_TINY).width + WidgetDimensions::scaled.hsep_wide;
 

	
 
			size->height = 4 * resize->height + WidgetDimensions::scaled.framerect.Vertical(); // At least 4 lines are visible.
 
			size->width = std::max(200u, size->width); // At least 200 pixels wide.
 
		}
 
	}
 

	
 
	void OnPaint() override
 
	{
 
		this->OnInvalidateData(0);
 
		this->DrawWidgets();
 
	}