mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r18250) -Codechange: make the graph legend big font aware
This commit is contained in:
parent
a71cc49498
commit
71ef26ca66
@ -75,11 +75,11 @@ struct GraphLegendWindow : Window {
|
|||||||
|
|
||||||
bool rtl = _dynlang.text_dir == TD_RTL;
|
bool rtl = _dynlang.text_dir == TD_RTL;
|
||||||
|
|
||||||
DrawCompanyIcon(cid, rtl ? r.right - 16 : r.left + 2, r.top + 2);
|
DrawCompanyIcon(cid, rtl ? r.right - 16 : r.left + 2, r.top + 2 + (FONT_HEIGHT_NORMAL - 10) / 2);
|
||||||
|
|
||||||
SetDParam(0, cid);
|
SetDParam(0, cid);
|
||||||
SetDParam(1, cid);
|
SetDParam(1, cid);
|
||||||
DrawString(r.left + (rtl ? WD_FRAMERECT_LEFT : 19), r.right - (rtl ? 19 : WD_FRAMERECT_RIGHT), r.top + 1, STR_COMPANY_NAME_COMPANY_NUM, HasBit(_legend_excluded_companies, cid) ? TC_BLACK : TC_WHITE);
|
DrawString(r.left + (rtl ? WD_FRAMERECT_LEFT : 19), r.right - (rtl ? 19 : WD_FRAMERECT_RIGHT), r.top + WD_FRAMERECT_TOP, STR_COMPANY_NAME_COMPANY_NUM, HasBit(_legend_excluded_companies, cid) ? TC_BLACK : TC_WHITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnClick(Point pt, int widget)
|
virtual void OnClick(Point pt, int widget)
|
||||||
@ -117,8 +117,8 @@ static NWidgetBase *MakeNWidgetCompanyLines(int *biggest_index)
|
|||||||
|
|
||||||
for (int widnum = GLW_FIRST_COMPANY; widnum <= GLW_LAST_COMPANY; widnum++) {
|
for (int widnum = GLW_FIRST_COMPANY; widnum <= GLW_LAST_COMPANY; widnum++) {
|
||||||
NWidgetBackground *panel = new NWidgetBackground(WWT_PANEL, COLOUR_GREY, widnum);
|
NWidgetBackground *panel = new NWidgetBackground(WWT_PANEL, COLOUR_GREY, widnum);
|
||||||
panel->SetMinimalSize(246, 12);
|
panel->SetMinimalSize(246, FONT_HEIGHT_NORMAL + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM);
|
||||||
panel->SetFill(0, 0);
|
panel->SetFill(1, 0);
|
||||||
panel->SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP);
|
panel->SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP);
|
||||||
vert->Add(panel);
|
vert->Add(panel);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user