From 9aaf8ee2032a116d615975aee444f70c64a5505b Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 19 Oct 2012 18:36:19 -0400 Subject: [PATCH] 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) --- src/preferences/keymap/KeyboardLayoutView.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/preferences/keymap/KeyboardLayoutView.cpp b/src/preferences/keymap/KeyboardLayoutView.cpp index 55677451b3..bbe8506c47 100644 --- a/src/preferences/keymap/KeyboardLayoutView.cpp +++ b/src/preferences/keymap/KeyboardLayoutView.cpp @@ -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(®ion); + BRect bgRect = rect.InsetByCopy(2, 2); be_control_look->DrawButtonBackground(view, bgRect, updateRect, 4.0f, 4.0f, 0.0f, 4.0f, base,