Ticket #13683: 0001-Fix-WebPositive-drawing-glitches.patch

File 0001-Fix-WebPositive-drawing-glitches.patch, 4.8 KB (added by KapiX, 7 years ago)
  • src/apps/webpositive/tabview/TabContainerView.cpp

    From 27891fc4be699341ce93e75198a17556c76d765e Mon Sep 17 00:00:00 2001
    From: Kacper Kasper <kacperkasper@gmail.com>
    Date: Sat, 26 Aug 2017 11:41:09 +0200
    Subject: [PATCH] Fix WebPositive drawing glitches.
    
    * Introduced with recent BTabView changes.
    * Adjust drawing tabs a bit.
    * Remove trailing whitespace.
    ---
     src/apps/webpositive/tabview/TabContainerView.cpp |  4 ----
     src/apps/webpositive/tabview/TabManager.cpp       |  9 ++++-----
     src/apps/webpositive/tabview/TabView.cpp          |  5 ++---
     src/kits/interface/ControlLook.cpp                |  2 +-
     src/kits/interface/TabView.cpp                    | 14 --------------
     5 files changed, 7 insertions(+), 27 deletions(-)
    
    diff --git a/src/apps/webpositive/tabview/TabContainerView.cpp b/src/apps/webpositive/tabview/TabContainerView.cpp
    index 9ce130f701..300173759a 100644
    a b TabContainerView::MessageReceived(BMessage* message)  
    7575void
    7676TabContainerView::Draw(BRect updateRect)
    7777{
    78     // Stroke separator line at bottom.
    7978    rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
    8079    BRect frame(Bounds());
    81     SetHighColor(tint_color(base, B_DARKEN_2_TINT));
    82     StrokeLine(frame.LeftBottom(), frame.RightBottom());
    83     frame.bottom--;
    8480
    8581    // Draw empty area before first tab.
    8682    uint32 borders = BControlLook::B_TOP_BORDER | BControlLook::B_BOTTOM_BORDER;
  • src/apps/webpositive/tabview/TabManager.cpp

    diff --git a/src/apps/webpositive/tabview/TabManager.cpp b/src/apps/webpositive/tabview/TabManager.cpp
    index e9e3da8468..dff37ca7b0 100644
    a b public:  
    6464    {
    6565        BRect bounds(Bounds());
    6666        rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
    67         SetHighColor(tint_color(base, B_DARKEN_2_TINT));
    68         StrokeLine(bounds.LeftBottom(), bounds.RightBottom());
    69         bounds.bottom--;
    7067        uint32 flags = be_control_look->Flags(this);
    7168        uint32 borders = BControlLook::B_TOP_BORDER
    7269            | BControlLook::B_BOTTOM_BORDER;
    public:  
    182179        bigtime_t clickSpeed = 2000000;
    183180        get_click_speed(&clickSpeed);
    184181        bigtime_t clickTime = Window()->CurrentMessage()->FindInt64("when");
    185         if (!IsEnabled() || (Value() == B_CONTROL_ON) 
     182        if (!IsEnabled() || (Value() == B_CONTROL_ON)
    186183            || clickTime < fCloseTime + clickSpeed) {
    187184            return;
    188185        }
    public:  
    284281                }
    285282                fTabMenuButton->MenuClosed();
    286283                delete tabMenu;
    287                
     284
    288285                break;
    289286            }
    290287            default:
    WebTabView::DrawContents(BView* owner, BRect frame, const BRect& updateRect,  
    513510                iconBounds.bottom = (fIcon->Bounds().Height() + 1) / scale - 1;
    514511            }
    515512        }
     513        // account for borders
     514        frame.top -= 2.0f;
    516515        BPoint iconPos(frame.left + kIconInset - 1,
    517516            frame.top + floorf((frame.Height() - iconBounds.Height()) / 2));
    518517        iconBounds.OffsetTo(iconPos);
  • src/apps/webpositive/tabview/TabView.cpp

    diff --git a/src/apps/webpositive/tabview/TabView.cpp b/src/apps/webpositive/tabview/TabView.cpp
    index af56ef5673..350bed59b9 100644
    a b TabView::Draw(BRect updateRect)  
    7777            frame.left--;
    7878        if (!fIsLast)
    7979            frame.right++;
    80 
    81         frame.bottom++;
    8280    }
     81    frame.bottom++;
    8382
    8483    DrawBackground(fContainerView, frame, updateRect, fIsFirst, fIsLast,
    8584        fIsFront);
    TabView::Update(bool isFirst, bool isLast, bool isFront)  
    180179    fIsFirst = isFirst;
    181180    fIsLast = isLast;
    182181    fIsFront = isFront;
    183    
     182
    184183    fLayoutItem->InvalidateContainer();
    185184}
    186185
  • src/kits/interface/ControlLook.cpp

    diff --git a/src/kits/interface/ControlLook.cpp b/src/kits/interface/ControlLook.cpp
    index 60ab9ae405..e6c76d12ab 100644
    a b BControlLook::DrawActiveTab(BView* view, BRect& rect, const BRect& updateRect,  
    15061506
    15071507    // draw the rest of frame and fill
    15081508    _DrawFrame(view, rect, edgeShadowColor, edgeShadowColor, edgeLightColor,
    1509         edgeLightColor, borders & bordersToDraw);
     1509        edgeLightColor, borders);
    15101510    if (side == B_TOP_BORDER || side == B_BOTTOM_BORDER) {
    15111511        if ((borders & B_LEFT_BORDER) == 0)
    15121512            rect.left++;
  • src/kits/interface/TabView.cpp

    diff --git a/src/kits/interface/TabView.cpp b/src/kits/interface/TabView.cpp
    index 271bc5f66e..8a35cd0a57 100644
    a b BTab::DrawTab(BView* owner, BRect frame, tab_position position, bool full)  
    340340    }
    341341
    342342    if (position == B_TAB_FRONT) {
    343         switch (fTabView->TabSide()) {
    344             case BTabView::kTopSide:
    345                 frame.bottom -= 1.0f;
    346                 break;
    347             case BTabView::kBottomSide:
    348                 frame.top += 1.0f;
    349                 break;
    350             case BTabView::kLeftSide:
    351                 frame.right -= 1.0f;
    352                 break;
    353             case BTabView::kRightSide:
    354                 frame.left += 1.0f;
    355                 break;
    356         }
    357343        be_control_look->DrawActiveTab(owner, frame, frame, no_tint, 0,
    358344            borders, fTabView->TabSide());
    359345    } else {