Changeset - r24785:0c41cd9cb4a7
[Not reviewed]
master
0 1 0
Charles Pigott - 4 years ago 2021-02-13 21:18:03
charlespigott@googlemail.com
Fix #8620: Scale spacing between date & news in history window according to font scaling
1 file changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/news_gui.cpp
Show inline comments
 
@@ -31,12 +31,13 @@
 
#include "core/geometry_func.hpp"
 
#include "command_func.h"
 
#include "company_base.h"
 
#include "settings_internal.h"
 
#include "guitimer_func.h"
 
#include "group_gui.h"
 
#include "zoom_func.h"
 

	
 
#include "widgets/news_widget.h"
 

	
 
#include "table/strings.h"
 

	
 
#include "safeguards.h"
 
@@ -1171,14 +1172,14 @@ struct MessageHistoryWindow : Window {
 

	
 
		/* Fill the widget with news items. */
 
		int y = r.top + this->top_spacing;
 
		bool rtl = _current_text_dir == TD_RTL;
 
		uint date_left  = rtl ? r.right - WD_FRAMERECT_RIGHT - this->date_width : r.left + WD_FRAMERECT_LEFT;
 
		uint date_right = rtl ? r.right - WD_FRAMERECT_RIGHT : r.left + WD_FRAMERECT_LEFT + this->date_width;
 
		uint news_left  = rtl ? r.left + WD_FRAMERECT_LEFT : r.left + WD_FRAMERECT_LEFT + this->date_width + WD_FRAMERECT_RIGHT;
 
		uint news_right = rtl ? r.right - WD_FRAMERECT_RIGHT - this->date_width - WD_FRAMERECT_RIGHT : r.right - WD_FRAMERECT_RIGHT;
 
		uint news_left  = rtl ? r.left + WD_FRAMERECT_LEFT : r.left + WD_FRAMERECT_LEFT + this->date_width + WD_FRAMERECT_RIGHT + ScaleFontTrad(5);
 
		uint news_right = rtl ? r.right - WD_FRAMERECT_RIGHT - this->date_width - WD_FRAMERECT_RIGHT - ScaleFontTrad(5) : r.right - WD_FRAMERECT_RIGHT;
 
		for (int n = this->vscroll->GetCapacity(); n > 0; n--) {
 
			SetDParam(0, ni->date);
 
			DrawString(date_left, date_right, y, STR_SHORT_DATE);
 

	
 
			DrawNewsString(news_left, news_right, y, TC_WHITE, ni);
 
			y += this->line_height;
0 comments (0 inline, 0 general)