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:
@@ -609,8 +609,6 @@ KeyboardLayoutView::_DrawKey(BView* view, BRect updateRect, const Key* key,
|
|||||||
be_control_look->DrawLabel(view, text, rect, updateRect,
|
be_control_look->DrawLabel(view, text, rect, updateRect,
|
||||||
base, 0, BAlignment(B_ALIGN_CENTER, B_ALIGN_MIDDLE));
|
base, 0, BAlignment(B_ALIGN_CENTER, B_ALIGN_MIDDLE));
|
||||||
} else if (key->shape == kEnterKeyShape) {
|
} else if (key->shape == kEnterKeyShape) {
|
||||||
BRegion region(rect);
|
|
||||||
|
|
||||||
BRect topLeft = rect;
|
BRect topLeft = rect;
|
||||||
BRect topRight = rect;
|
BRect topRight = rect;
|
||||||
BRect bottomLeft = rect;
|
BRect bottomLeft = rect;
|
||||||
@@ -632,10 +630,8 @@ KeyboardLayoutView::_DrawKey(BView* view, BRect updateRect, const Key* key,
|
|||||||
bottomRight.top = bottomLeft.top;
|
bottomRight.top = bottomLeft.top;
|
||||||
bottomRight.left = bottomLeft.right;
|
bottomRight.left = bottomLeft.right;
|
||||||
|
|
||||||
bottomLeft.OffsetBy(1, -2);
|
|
||||||
|
|
||||||
be_control_look->DrawButtonFrame(view, topLeft, updateRect,
|
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,
|
pressed ? BControlLook::B_ACTIVATED : 0,
|
||||||
BControlLook::B_LEFT_BORDER | BControlLook::B_TOP_BORDER
|
BControlLook::B_LEFT_BORDER | BControlLook::B_TOP_BORDER
|
||||||
| BControlLook::B_BOTTOM_BORDER);
|
| BControlLook::B_BOTTOM_BORDER);
|
||||||
@@ -644,16 +640,18 @@ KeyboardLayoutView::_DrawKey(BView* view, BRect updateRect, const Key* key,
|
|||||||
pressed ? BControlLook::B_ACTIVATED : 0,
|
pressed ? BControlLook::B_ACTIVATED : 0,
|
||||||
BControlLook::B_TOP_BORDER | BControlLook::B_RIGHT_BORDER);
|
BControlLook::B_TOP_BORDER | BControlLook::B_RIGHT_BORDER);
|
||||||
be_control_look->DrawButtonFrame(view, bottomRight, updateRect,
|
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,
|
pressed ? BControlLook::B_ACTIVATED : 0,
|
||||||
BControlLook::B_LEFT_BORDER | BControlLook::B_RIGHT_BORDER
|
BControlLook::B_LEFT_BORDER | BControlLook::B_RIGHT_BORDER
|
||||||
| BControlLook::B_BOTTOM_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);
|
region.Exclude(bottomLeft);
|
||||||
view->ConstrainClippingRegion(®ion);
|
view->ConstrainClippingRegion(®ion);
|
||||||
|
|
||||||
BRect bgRect = rect.InsetByCopy(2, 2);
|
BRect bgRect = rect.InsetByCopy(2, 2);
|
||||||
be_control_look->DrawButtonBackground(view, bgRect, updateRect,
|
be_control_look->DrawButtonBackground(view, bgRect, updateRect,
|
||||||
4.0f, 4.0f, 0.0f, 4.0f, base,
|
4.0f, 4.0f, 0.0f, 4.0f, base,
|
||||||
|
|||||||
Reference in New Issue
Block a user