Nikolay Sivov : comctl32/datetime: Draw field text horizontally centered.
Alexandre Julliard
julliard at winehq.org
Fri Oct 9 09:24:12 CDT 2009
Module: wine
Branch: master
Commit: d083e7701b1fbefaf4a7e29f2fa7fab478d8356e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d083e7701b1fbefaf4a7e29f2fa7fab478d8356e
Author: Nikolay Sivov <bunglehead at gmail.com>
Date: Fri Oct 9 01:49:10 2009 +0400
comctl32/datetime: Draw field text horizontally centered.
---
dlls/comctl32/datetime.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c
index 9b4926c..0165166 100644
--- a/dlls/comctl32/datetime.c
+++ b/dlls/comctl32/datetime.c
@@ -712,12 +712,13 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc)
/* fill if focused */
HBRUSH hbr = CreateSolidBrush (comctl32_color.clrActiveCaption);
- selection.right = field->right;
- selection.left = selection.right - size.cx;
+ selection.left = 0;
selection.top = 0;
+ selection.right = size.cx;
selection.bottom = size.cy;
/* center rectangle */
- OffsetRect(&selection, 0, (field->bottom - size.cy)/2);
+ OffsetRect(&selection, (field->right + field->left - size.cx)/2,
+ (field->bottom - size.cy)/2);
FillRect(hdc, &selection, hbr);
DeleteObject (hbr);
@@ -727,7 +728,7 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc)
oldTextColor = SetTextColor (hdc, comctl32_color.clrWindowText);
/* draw the date text using the colour set above */
- DrawTextW (hdc, txt, strlenW(txt), field, DT_RIGHT | DT_VCENTER | DT_SINGLELINE);
+ DrawTextW (hdc, txt, strlenW(txt), field, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
SetTextColor (hdc, oldTextColor);
}
SetBkMode (hdc, oldBkMode);
More information about the wine-cvs
mailing list