mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 10:30:28 +00:00
(svn r19849) -Fix: Center sprite and text seperately in the newgrf gui active list.
This commit is contained in:
parent
255a3331bf
commit
bee74bd82b
@ -343,7 +343,8 @@ struct NewGRFWindow : public QueryStringBaseWindow {
|
|||||||
|
|
||||||
uint step_height = this->GetWidget<NWidgetBase>(SNGRFS_FILE_LIST)->resize_y;
|
uint step_height = this->GetWidget<NWidgetBase>(SNGRFS_FILE_LIST)->resize_y;
|
||||||
uint y = r.top + WD_FRAMERECT_TOP;
|
uint y = r.top + WD_FRAMERECT_TOP;
|
||||||
int sprite_offset_y = (step_height - FONT_HEIGHT_NORMAL) / 2;
|
int sprite_offset_y = (step_height - 10) / 2;
|
||||||
|
int offset_y = (step_height - FONT_HEIGHT_NORMAL) / 2;
|
||||||
|
|
||||||
bool rtl = _dynlang.text_dir == TD_RTL;
|
bool rtl = _dynlang.text_dir == TD_RTL;
|
||||||
uint text_left = rtl ? r.left + WD_FRAMERECT_LEFT : r.left + 25;
|
uint text_left = rtl ? r.left + WD_FRAMERECT_LEFT : r.left + 25;
|
||||||
@ -362,7 +363,7 @@ struct NewGRFWindow : public QueryStringBaseWindow {
|
|||||||
DrawSprite(SPR_SQUARE, pal, square_left, y + sprite_offset_y);
|
DrawSprite(SPR_SQUARE, pal, square_left, y + sprite_offset_y);
|
||||||
if (c->error != NULL) DrawSprite(SPR_WARNING_SIGN, 0, warning_left, y + sprite_offset_y);
|
if (c->error != NULL) DrawSprite(SPR_WARNING_SIGN, 0, warning_left, y + sprite_offset_y);
|
||||||
uint txtoffset = c->error == NULL ? 0 : 10;
|
uint txtoffset = c->error == NULL ? 0 : 10;
|
||||||
DrawString(text_left + (rtl ? 0 : txtoffset), text_right - (rtl ? txtoffset : 0), y + sprite_offset_y, text, h ? TC_WHITE : TC_ORANGE);
|
DrawString(text_left + (rtl ? 0 : txtoffset), text_right - (rtl ? txtoffset : 0), y + offset_y, text, h ? TC_WHITE : TC_ORANGE);
|
||||||
y += step_height;
|
y += step_height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user