diff --git a/TODO b/TODO index 7278e15..706fa88 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -* Continue rebasing from 840e2ea3b13eb24057b8505eaa615d4e6bd363c6 +* Continue rebasing from ac25684370f72e5e204bd994fd736e630fb8425a * Add a focus listener interface. * Make focus apply synchronously. * Graphics and input objects for DirectX. diff --git a/src/widgets/textfield.cpp b/src/widgets/textfield.cpp index 1ea8de4..8b39d84 100644 --- a/src/widgets/textfield.cpp +++ b/src/widgets/textfield.cpp @@ -128,6 +128,13 @@ namespace gcn graphics->setColor(getBackgroundColor()); graphics->fillRectangle(Rectangle(0, 0, getWidth(), getHeight())); + if (isFocused()) + { + graphics->setColor(getSelectionColor()); + graphics->drawRectangle(Rectangle(0, 0, getWidth() - 2, getHeight() - 2)); + graphics->drawRectangle(Rectangle(1, 1, getWidth() - 4, getHeight() - 4)); + } + if (isFocused() && isEditable()) { drawCaret(graphics, getFont()->getWidth(mText.substr(0, mCaretPosition)) - mXScroll); @@ -233,7 +240,7 @@ namespace gcn void TextField::adjustSize() { - setWidth(getFont()->getWidth(mText) + 4); + setWidth(getFont()->getWidth(mText) + 7); adjustHeight(); fixScroll();