summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-18 21:27:13 +0000
committerrubidium <rubidium@openttd.org>2009-11-18 21:27:13 +0000
commit45a7bce83d2df2e0942a97754a4f8f1749a2c828 (patch)
treee7f7b50a200d08cf231f9c0970073b3359138b24 /src
parent5a15fbde11aa0c057b81a40ee33e54fed22b45b0 (diff)
downloadopenttd-45a7bce83d2df2e0942a97754a4f8f1749a2c828.tar.xz
(svn r18174) -Codechange: make the sign list RTL aware
Diffstat (limited to 'src')
-rw-r--r--src/signs_gui.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp
index d87d03da4..cb54f3efb 100644
--- a/src/signs_gui.cpp
+++ b/src/signs_gui.cpp
@@ -119,14 +119,19 @@ struct SignListWindow : Window, SignList {
return;
}
+ bool rtl = _dynlang.text_dir == TD_RTL;
+ uint icon_left = 4 + (rtl ? r.right - this->text_offset : r.left);
+ uint text_left = r.left + (rtl ? WD_FRAMERECT_LEFT : this->text_offset);
+ uint text_right = r.right - (rtl ? this->text_offset : WD_FRAMERECT_RIGHT);
+
/* At least one sign available. */
for (uint16 i = this->vscroll.GetPosition(); this->vscroll.IsVisible(i) && i < this->vscroll.GetCount(); i++) {
const Sign *si = this->signs[i];
- if (si->owner != OWNER_NONE) DrawCompanyIcon(si->owner, r.left + 4, y + 1);
+ if (si->owner != OWNER_NONE) DrawCompanyIcon(si->owner, icon_left, y + 1);
SetDParam(0, si->index);
- DrawString(r.left + this->text_offset, r.right - WD_FRAMETEXT_RIGHT, y, STR_SIGN_NAME, TC_YELLOW);
+ DrawString(text_left, text_right, y, STR_SIGN_NAME, TC_YELLOW);
y += this->resize.step_height;
}
break;