Draw strings vertically aligned on some windows.

This commit is contained in:
Juanjo
2013-06-29 11:53:50 +02:00
committed by pelya
parent cc62096ac4
commit cab76bd7af
20 changed files with 103 additions and 111 deletions

View File

@@ -786,11 +786,12 @@ void QueryString::DrawEditBox(const Window *w, int wid) const
/* If we have a marked area, draw a background highlight. */
if (tb->marklength != 0) GfxFillRect(delta + tb->markxoffs, 0, delta + tb->markxoffs + tb->marklength - 1, bottom - top, PC_GREY);
DrawString(delta, tb->pixels, 0, tb->buf, TC_YELLOW);
DrawString(delta, tb->pixels, Center(0, bottom - top), tb->buf, TC_YELLOW);
bool focussed = w->IsWidgetGloballyFocused(wid) || IsOSKOpenedFor(w, wid);
if (focussed && tb->caret) {
int caret_width = GetStringBoundingBox("_").width;
DrawString(tb->caretxoffs + delta, tb->caretxoffs + delta + caret_width, 0, "_", TC_WHITE);
DrawString(tb->caretxoffs + delta, tb->caretxoffs + delta + caret_width, Center(0, bottom - top), "_", TC_WHITE);
}
_cur_dpi = old_dpi;