@@ -25,24 +25,25 @@
#include "widgets/dropdown_func.h"
#include "statusbar_gui.h"
#include "company_manager_face.h"
#include "company_func.h"
#include "engine_base.h"
#include "engine_gui.h"
#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"
const NewsItem *_statusbar_news_item = nullptr;
static uint MIN_NEWS_AMOUNT = 30; ///< preferred minimum amount of news messages
static uint MAX_NEWS_AMOUNT = 1 << 10; ///< Do not exceed this number of news messages
static uint _total_news = 0; ///< current number of news items
@@ -1165,26 +1166,26 @@ struct MessageHistoryWindow : Window {
/* Find the first news item to display. */
NewsItem *ni = _latest_news;
for (int n = this->vscroll->GetPosition(); n > 0; n--) {
ni = ni->prev;
if (ni == nullptr) return;
}
/* 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;
Status change: