changeset 11472:cb478e40b8e2 draft

(svn r15833) -Fix: alignment of up/down arrows and closebox when in RTL 'view'
author rubidium <rubidium@openttd.org>
date Mon, 23 Mar 2009 22:20:23 +0000
parents 3941ac1268d5
children 8675fcec484e
files src/widget.cpp
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -319,11 +319,11 @@
 			/* draw up/down buttons */
 			clicked = ((this->flags4 & (WF_SCROLL_UP | WF_HSCROLL | WF_SCROLL2)) == WF_SCROLL_UP);
 			DrawFrameRect(r.left, r.top, r.right, r.top + 9, wi->colour, (clicked) ? FR_LOWERED : FR_NONE);
-			DrawString(r.left + 2 + clicked, r.right, r.top + clicked, UPARROW, TC_BLACK);
+			DrawString(r.left + clicked, r.right + clicked, r.top + clicked, UPARROW, TC_BLACK, SA_CENTER);
 
 			clicked = (((this->flags4 & (WF_SCROLL_DOWN | WF_HSCROLL | WF_SCROLL2)) == WF_SCROLL_DOWN));
 			DrawFrameRect(r.left, r.bottom - 9, r.right, r.bottom, wi->colour, (clicked) ? FR_LOWERED : FR_NONE);
-			DrawString(r.left + 2 + clicked, r.right, r.bottom - 9 + clicked, DOWNARROW, TC_BLACK);
+			DrawString(r.left + clicked, r.right + clicked, r.bottom - 9 + clicked, DOWNARROW, TC_BLACK, SA_CENTER);
 
 			int c1 = _colour_gradient[wi->colour & 0xF][3];
 			int c2 = _colour_gradient[wi->colour & 0xF][7];
@@ -350,11 +350,11 @@
 			/* draw up/down buttons */
 			clicked = ((this->flags4 & (WF_SCROLL_UP | WF_HSCROLL | WF_SCROLL2)) == (WF_SCROLL_UP | WF_SCROLL2));
 			DrawFrameRect(r.left, r.top, r.right, r.top + 9, wi->colour,  (clicked) ? FR_LOWERED : FR_NONE);
-			DrawString(r.left + 2 + clicked, r.right, r.top + clicked, UPARROW, TC_BLACK);
+			DrawString(r.left + clicked, r.right + clicked, r.top + clicked, UPARROW, TC_BLACK, SA_CENTER);
 
 			clicked = ((this->flags4 & (WF_SCROLL_DOWN | WF_HSCROLL | WF_SCROLL2)) == (WF_SCROLL_DOWN | WF_SCROLL2));
 			DrawFrameRect(r.left, r.bottom - 9, r.right, r.bottom, wi->colour,  (clicked) ? FR_LOWERED : FR_NONE);
-			DrawString(r.left + 2 + clicked, r.right, r.bottom - 9 + clicked, DOWNARROW, TC_BLACK);
+			DrawString(r.left + clicked, r.right + clicked, r.bottom - 9 + clicked, DOWNARROW, TC_BLACK, SA_CENTER);
 
 			int c1 = _colour_gradient[wi->colour & 0xF][3];
 			int c2 = _colour_gradient[wi->colour & 0xF][7];
@@ -477,7 +477,7 @@
 			assert(r.right - r.left == 10); // To ensure the same sizes are used everywhere
 
 			DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->colour, FR_NONE);
-			DrawString(r.left + 2, r.right, r.top + 2, str, TC_FROMSTRING);
+			DrawString(r.left, r.right, r.top + 2, str, TC_FROMSTRING, SA_CENTER);
 			break;
 		}
 
@@ -500,12 +500,12 @@
 			if (_dynlang.text_dir == TD_LTR) {
 				DrawFrameRect(r.left, r.top, r.right - 12, r.bottom, wi->colour, FR_NONE);
 				DrawFrameRect(r.right - 11, r.top, r.right, r.bottom, wi->colour, clicked ? FR_LOWERED : FR_NONE);
-				DrawString(r.right - (clicked ? 8 : 9), r.right, r.top + (clicked ? 2 : 1), STR_0225, TC_BLACK);
+				DrawString(r.right - (clicked ? 10 : 11), r.right, r.top + (clicked ? 2 : 1), STR_0225, TC_BLACK, SA_CENTER);
 				if (str != STR_NULL) DrawString(r.left + 2, r.right - 14, r.top + 1, str, TC_BLACK);
 			} else {
 				DrawFrameRect(r.left + 12, r.top, r.right, r.bottom, wi->colour, FR_NONE);
 				DrawFrameRect(r.left, r.top, r.left + 11, r.bottom, wi->colour, clicked ? FR_LOWERED : FR_NONE);
-				DrawString(r.left + 1, r.left + (clicked ? 10 : 11), r.top + (clicked ? 2 : 1), STR_0225, TC_BLACK);
+				DrawString(r.left + clicked, r.left + 11, r.top + (clicked ? 2 : 1), STR_0225, TC_BLACK, SA_CENTER);
 				if (str != STR_NULL) DrawString(r.left + 14, r.right - 2, r.top + 1, str, TC_BLACK);
 			}
 			break;