File diff r20286:587cdb3a1f1e → r20287:5b9a8691769e
src/news_gui.cpp
Show inline comments
 
@@ -1075,48 +1075,49 @@ struct MessageHistoryWindow : Window {
 

	
 
			for (int n = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_MH_BACKGROUND, WD_FRAMERECT_TOP, this->line_height); n > 0; n--) {
 
				ni = ni->prev;
 
				if (ni == NULL) return;
 
			}
 

	
 
			ShowNewsMessage(ni);
 
		}
 
	}
 

	
 
	virtual void OnResize()
 
	{
 
		this->vscroll->SetCapacity(this->GetWidget<NWidgetBase>(WID_MH_BACKGROUND)->current_y / this->line_height);
 
	}
 
};
 

	
 
const int MessageHistoryWindow::top_spacing = WD_FRAMERECT_TOP + 4;
 
const int MessageHistoryWindow::bottom_spacing = WD_FRAMERECT_BOTTOM;
 

	
 
static const NWidgetPart _nested_message_history[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
 
		NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_MESSAGE_HISTORY, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_BROWN),
 
		NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
 
		NWidget(WWT_STICKYBOX, COLOUR_BROWN),
 
	EndContainer(),
 

	
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PANEL, COLOUR_BROWN, WID_MH_BACKGROUND), SetMinimalSize(200, 125), SetDataTip(0x0, STR_MESSAGE_HISTORY_TOOLTIP), SetResize(1, 12), SetScrollbar(WID_MH_SCROLLBAR),
 
		EndContainer(),
 
		NWidget(NWID_VERTICAL),
 
			NWidget(NWID_VSCROLLBAR, COLOUR_BROWN, WID_MH_SCROLLBAR),
 
			NWidget(WWT_RESIZEBOX, COLOUR_BROWN),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
static WindowDesc _message_history_desc(
 
	WDP_AUTO, "list_news", 400, 140,
 
	WC_MESSAGE_HISTORY, WC_NONE,
 
	0,
 
	_nested_message_history, lengthof(_nested_message_history)
 
);
 

	
 
/** Display window with news messages history */
 
void ShowMessageHistory()
 
{
 
	DeleteWindowById(WC_MESSAGE_HISTORY, 0);