From c5298440eab9ab1bac844d41a642d8c5b0e5fd7e Mon Sep 17 00:00:00 2001
From: Kacper Kasper <kacperkasper@gmail.com>
Date: Sun, 29 Jan 2017 21:13:01 +0100
Subject: [PATCH] ControlLook: Fix redraw issues introduced in hrev50893.
* I was pretty sure that I didn't change the logic, but turns out
I was wrong. Sorry about that.
* Adjusted copy-pasted comments.
---
src/kits/interface/ControlLook.cpp | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/kits/interface/ControlLook.cpp b/src/kits/interface/ControlLook.cpp
index 7a00152..fbaadad 100644
a
|
b
|
BControlLook::DrawActiveTab(BView* view, BRect& rect, const BRect& updateRect,
|
1445 | 1445 | clipping.Exclude(leftBottomCorner); |
1446 | 1446 | clipping.Exclude(rightBottomCorner); |
1447 | 1447 | |
1448 | | // draw the left top corner |
| 1448 | // draw the left bottom corner |
1449 | 1449 | _DrawRoundCornerLeftBottom(view, leftBottomCorner, updateRect, base, |
1450 | 1450 | edgeShadowColor, edgeLightColor, frameLightColor, |
1451 | 1451 | frameShadowColor, bevelLightColor, bevelShadowColor, |
1452 | 1452 | fillGradient); |
1453 | | // draw the right top corner |
| 1453 | // draw the right bottom corner |
1454 | 1454 | _DrawRoundCornerRightBottom(view, rightBottomCorner, updateRect, |
1455 | 1455 | base, edgeLightColor, frameShadowColor, bevelShadowColor, |
1456 | 1456 | fillGradient); |
… |
… |
BControlLook::DrawActiveTab(BView* view, BRect& rect, const BRect& updateRect,
|
1463 | 1463 | _DrawRoundCornerLeftTop(view, leftTopCorner, updateRect, base, |
1464 | 1464 | edgeShadowColor, frameLightColor, bevelLightColor, |
1465 | 1465 | fillGradient); |
1466 | | // draw the left top corner |
| 1466 | // draw the left bottom corner |
1467 | 1467 | _DrawRoundCornerLeftBottom(view, leftBottomCorner, updateRect, base, |
1468 | 1468 | edgeShadowColor, edgeLightColor, frameLightColor, |
1469 | 1469 | frameShadowColor, bevelLightColor, bevelShadowColor, |
… |
… |
BControlLook::DrawActiveTab(BView* view, BRect& rect, const BRect& updateRect,
|
1478 | 1478 | edgeShadowColor, edgeLightColor, frameLightColor, |
1479 | 1479 | frameShadowColor, bevelLightColor, bevelShadowColor, |
1480 | 1480 | fillGradient); |
1481 | | // draw the right top corner |
| 1481 | // draw the right bottom corner |
1482 | 1482 | _DrawRoundCornerRightBottom(view, rightBottomCorner, updateRect, |
1483 | 1483 | base, edgeLightColor, frameShadowColor, bevelShadowColor, |
1484 | 1484 | fillGradient); |
… |
… |
BControlLook::DrawInactiveTab(BView* view, BRect& rect, const BRect& updateRect,
|
1569 | 1569 | fillGradient.AddColor(tint_color(base, 1.08), 255); |
1570 | 1570 | } |
1571 | 1571 | |
| 1572 | BRect background = rect; |
1572 | 1573 | uint32 bordersToDraw = 0; |
1573 | 1574 | switch (side) { |
1574 | 1575 | case B_TOP_BORDER: |
1575 | 1576 | bordersToDraw = (B_LEFT_BORDER | B_TOP_BORDER | B_RIGHT_BORDER); |
1576 | 1577 | rect.top += 4; |
| 1578 | background.bottom = rect.top; |
1577 | 1579 | break; |
1578 | 1580 | case B_BOTTOM_BORDER: |
1579 | 1581 | bordersToDraw = (B_LEFT_BORDER | B_BOTTOM_BORDER | B_RIGHT_BORDER); |
1580 | 1582 | rect.bottom -= 4; |
| 1583 | background.top = rect.bottom; |
1581 | 1584 | break; |
1582 | 1585 | case B_LEFT_BORDER: |
1583 | 1586 | bordersToDraw = (B_LEFT_BORDER | B_BOTTOM_BORDER | B_TOP_BORDER); |
1584 | 1587 | rect.left += 4; |
| 1588 | background.right = rect.left; |
1585 | 1589 | break; |
1586 | 1590 | case B_RIGHT_BORDER: |
1587 | 1591 | bordersToDraw = (B_RIGHT_BORDER | B_BOTTOM_BORDER | B_TOP_BORDER); |
1588 | 1592 | rect.right -= 4; |
| 1593 | background.left = rect.right; |
1589 | 1594 | break; |
1590 | 1595 | } |
1591 | 1596 | |
1592 | 1597 | // active tabs stand out at the top, but this is an inactive tab |
1593 | 1598 | view->SetHighColor(base); |
1594 | | view->FillRect(rect); |
| 1599 | view->FillRect(background); |
1595 | 1600 | |
1596 | 1601 | // frame and fill |
1597 | 1602 | _DrawFrame(view, rect, edgeShadowColor, edgeShadowColor, edgeLightColor, |