summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-18 12:31:48 +0000
committerrubidium <rubidium@openttd.org>2009-11-18 12:31:48 +0000
commit0fc733f3a0bffc1de1a421d288d8b6900c04a9b8 (patch)
tree577d4be2ac8f788b596da5d7c3f9183289619319
parent76a5f4f8cd30254e2e1c605e4af48940cb6552e5 (diff)
downloadopenttd-0fc733f3a0bffc1de1a421d288d8b6900c04a9b8.tar.xz
(svn r18165) -Codechange: make company dropdowns RTL aware
-rw-r--r--src/toolbar_gui.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index 3ef08a1ab..9a3fbf0b3 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -162,11 +162,12 @@ public:
void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const
{
CompanyID company = (CompanyID)result;
+ bool rtl = _dynlang.text_dir == TD_RTL;
/* It's possible the company is deleted while the dropdown is open */
if (!Company::IsValidID(company)) return;
- DrawCompanyIcon(company, left + 2, top + 1);
+ DrawCompanyIcon(company, rtl ? right - 16 : left + 2, top + 1);
SetDParam(0, company);
SetDParam(1, company);
@@ -176,7 +177,7 @@ public:
} else {
col = sel ? TC_WHITE : TC_BLACK;
}
- DrawString(left + 19, right - 2, top, STR_COMPANY_NAME_COMPANY_NUM, col);
+ DrawString(rtl ? left + 2 : left + 19, rtl ? right - 19 : right - 2, top, STR_COMPANY_NAME_COMPANY_NUM, col);
}
};