Ticket #13496: 0001-Tracker-Fix-blue-border-for-focus-in-file-panel.patch

File 0001-Tracker-Fix-blue-border-for-focus-in-file-panel.patch, 2.0 KB (added by owenca, 2 years ago)
  • src/kits/tracker/ContainerWindow.cpp

    From 8b55d45257c10e1f746d45d69614d4731a77d147 Mon Sep 17 00:00:00 2001
    From: Owen <owenca@users.noreply.github.com>
    Date: Sun, 14 May 2017 12:44:21 +0000
    Subject: [PATCH] Tracker: Fix blue border for focus in file panel.
    
    This fixes the bugs pertaining to drawing and erasing the blue border
    when a view gains and loses the focus, respectively. It also fixes the
    bug that the file list (PoseView) always has a blue border when the
    panel window is activated, even if the pose view doesn't have the focus.
    
    Fixes #13496.
    ---
     src/kits/tracker/ContainerWindow.cpp | 23 ++++++++++++++---------
     1 file changed, 14 insertions(+), 9 deletions(-)
    
    diff --git a/src/kits/tracker/ContainerWindow.cpp b/src/kits/tracker/ContainerWindow.cpp
    index 11c8d48..718d0bb 100644
    a b BorderedView::BorderedView()  
    43964396void
    43974397BorderedView::WindowActivated(bool active)
    43984398{
    4399     // Update border color
    4400     PoseViewFocused(active);
     4399    BContainerWindow* window = dynamic_cast<BContainerWindow*>(Window());
     4400    if (window == NULL)
     4401        return;
     4402
     4403    if (window->PoseView()->IsFocus())
     4404        PoseViewFocused(active);    // Update border color
    44014405}
    44024406
    44034407
    BorderedView::PoseViewFocused(bool focused)  
    44204424    if (focused && window->IsActive() && fEnableBorderHighlight) {
    44214425        base = B_KEYBOARD_NAVIGATION_COLOR;
    44224426        tint = B_NO_TINT;
     4427    }
    44234428
    4424         BScrollBar* hScrollBar = window->PoseView()->HScrollBar();
    4425         if (hScrollBar != NULL)
    4426             hScrollBar->SetBorderHighlighted(focused);
     4429    BScrollBar* hScrollBar = window->PoseView()->HScrollBar();
     4430    if (hScrollBar != NULL)
     4431        hScrollBar->SetBorderHighlighted(focused);
     4432
     4433    BScrollBar* vScrollBar = window->PoseView()->VScrollBar();
     4434    if (vScrollBar != NULL)
     4435        vScrollBar->SetBorderHighlighted(focused);
    44274436
    4428         BScrollBar* vScrollBar = window->PoseView()->VScrollBar();
    4429         if (vScrollBar != NULL)
    4430             vScrollBar->SetBorderHighlighted(focused);
    4431     }
    44324437    SetViewUIColor(base, tint);
    44334438    Invalidate();
    44344439}