Draw the inner corner of the enter key with square edges.

This completes the rework of the return key drawing code and fixes
bug #8700. (+alpha4)
This commit is contained in:
John Scipione 2012-10-19 18:36:19 -04:00
parent a8c0ae81ab
commit 9aaf8ee203
1 changed files with 7 additions and 9 deletions

View File

@ -609,8 +609,6 @@ KeyboardLayoutView::_DrawKey(BView* view, BRect updateRect, const Key* key,
be_control_look->DrawLabel(view, text, rect, updateRect,
base, 0, BAlignment(B_ALIGN_CENTER, B_ALIGN_MIDDLE));
} else if (key->shape == kEnterKeyShape) {
BRegion region(rect);
BRect topLeft = rect;
BRect topRight = rect;
BRect bottomLeft = rect;
@ -632,10 +630,8 @@ KeyboardLayoutView::_DrawKey(BView* view, BRect updateRect, const Key* key,
bottomRight.top = bottomLeft.top;
bottomRight.left = bottomLeft.right;
bottomLeft.OffsetBy(1, -2);
be_control_look->DrawButtonFrame(view, topLeft, updateRect,
4.0f, 0.0f, 4.0f, 0.0f, base, background,
4.0f, 0.0f, 0.0f, 0.0f, base, background,
pressed ? BControlLook::B_ACTIVATED : 0,
BControlLook::B_LEFT_BORDER | BControlLook::B_TOP_BORDER
| BControlLook::B_BOTTOM_BORDER);
@ -644,16 +640,18 @@ KeyboardLayoutView::_DrawKey(BView* view, BRect updateRect, const Key* key,
pressed ? BControlLook::B_ACTIVATED : 0,
BControlLook::B_TOP_BORDER | BControlLook::B_RIGHT_BORDER);
be_control_look->DrawButtonFrame(view, bottomRight, updateRect,
0.0f, 0.0f, 4.0f, 4.0f, base, background,
0.0f, 0.0f, 0.0f, 4.0f, base, background,
pressed ? BControlLook::B_ACTIVATED : 0,
BControlLook::B_LEFT_BORDER | BControlLook::B_RIGHT_BORDER
| BControlLook::B_BOTTOM_BORDER);
be_control_look->DrawButtonFrame(view, bottomLeft, updateRect, base,
background, pressed ? BControlLook::B_ACTIVATED : 0,
BControlLook::B_TOP_BORDER | BControlLook::B_RIGHT_BORDER);
// Clip out the bottom left corner
bottomLeft.right += 1;
bottomLeft.top -= 2;
BRegion region(rect);
region.Exclude(bottomLeft);
view->ConstrainClippingRegion(&region);
BRect bgRect = rect.InsetByCopy(2, 2);
be_control_look->DrawButtonBackground(view, bgRect, updateRect,
4.0f, 4.0f, 0.0f, 4.0f, base,