Fix: Small order list arrow was wrong direction for RTL text. (#14174)

Add sprite for small left arrow and use for small order list when using an RTL language.
This commit is contained in:
Peter Nelson
2025-05-01 22:08:24 +01:00
committed by GitHub
parent 41b113840a
commit d958d50985
8 changed files with 10 additions and 3 deletions

View File

@@ -477,7 +477,7 @@ Dimension BaseVehicleListWindow::GetActionDropdownSize(bool show_autoreplace, bo
void BaseVehicleListWindow::OnInit()
{
this->order_arrow_width = GetStringBoundingBox(STR_JUST_RIGHT_ARROW, FS_SMALL).width;
this->order_arrow_width = std::max(GetStringBoundingBox(STR_JUST_LEFT_ARROW, FS_SMALL).width, GetStringBoundingBox(STR_JUST_RIGHT_ARROW, FS_SMALL).width);
this->SetCargoFilterArray();
}
@@ -1666,7 +1666,7 @@ static void DrawSmallOrderList(const Vehicle *v, int left, int right, int y, uin
VehicleOrderID oid = start;
do {
if (oid == v->cur_real_order_index) DrawString(left, right, y, STR_JUST_RIGHT_ARROW, TC_BLACK, SA_LEFT, false, FS_SMALL);
if (oid == v->cur_real_order_index) DrawString(left, right, y, rtl ? STR_JUST_LEFT_ARROW : STR_JUST_RIGHT_ARROW, TC_BLACK, SA_LEFT, false, FS_SMALL);
if (order->IsType(OT_GOTO_STATION)) {
DrawString(left + l_offset, right - r_offset, y, GetString(STR_STATION_NAME, order->GetDestination()), TC_BLACK, SA_LEFT, false, FS_SMALL);