Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of el17ajf by
Diff: Menus/UI/UI.cpp
- Revision:
- 18:24ce897024d0
- Parent:
- 17:cc448ab7266f
- Child:
- 19:370d83a8dc33
--- a/Menus/UI/UI.cpp Wed Apr 03 13:37:56 2019 +0000 +++ b/Menus/UI/UI.cpp Wed Apr 03 14:31:49 2019 +0000 @@ -40,8 +40,15 @@ bool selected = buttonCurrentlyDrawing == buttonCurrentlySelected; + int wordWidth = strlen(text) * (Graphics::UI::CHAR_WIDTH + Graphics::UI::CHAR_SPACE); + if (selected) { - Graphics::UI::drawBorder(PADDING_X - 2, y - 2, PADDING_X + 50, y + Graphics::UI::CHAR_HEIGHT + 2); + Graphics::UI::drawBorder( + PADDING_X - 2, + y - 2, + PADDING_X + wordWidth + 2, + y + Graphics::UI::CHAR_HEIGHT + 1 + ); } return buttonPressedFrame && selected;