From d3171391fa18bcfe3d2bc852045ec98de0596a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 9 Apr 2009 23:49:49 +0000 Subject: [PATCH] Fixes for the B_NO_BORDER LOOK: * Draw the left/top border anyways, since it just looks bad with scrollbars where the frame cannot be turned off. But, don't draw the focus indication in this mode. * Fixed layout of the views for B_NO_BORDER_LOOK. There was a one pixel overlap. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30090 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/ColumnListView.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/kits/interface/ColumnListView.cpp b/src/kits/interface/ColumnListView.cpp index 45cfbfc930..53d5a97939 100644 --- a/src/kits/interface/ColumnListView.cpp +++ b/src/kits/interface/ColumnListView.cpp @@ -1539,11 +1539,10 @@ BColumnListView::MakeFocus(bool isFocus) if (fBorderStyle != B_NO_BORDER) { // Redraw focus marks around view Invalidate(); + fHorizontalScrollBar->SetBorderHighlighted(isFocus); + fVerticalScrollBar->SetBorderHighlighted(isFocus); } - fHorizontalScrollBar->SetBorderHighlighted(isFocus); - fVerticalScrollBar->SetBorderHighlighted(isFocus); - BView::MakeFocus(isFocus); } @@ -1696,9 +1695,23 @@ BColumnListView::Draw(BRect updateRect) if (!fHorizontalScrollBar->IsHidden()) horizontalScrollBarFrame = fHorizontalScrollBar->Frame(); + if (fBorderStyle == B_NO_BORDER) { + // We still draw the left/top border, but not focused. + // The scrollbars cannot be displayed without frame and + // it looks bad to have no frame only along the left/top + // side. + rgb_color borderColor = tint_color(base, B_DARKEN_2_TINT); + SetHighColor(borderColor); + StrokeLine(BPoint(rect.left, rect.bottom), + BPoint(rect.left, rect.top)); + StrokeLine(BPoint(rect.left + 1, rect.top), + BPoint(rect.right, rect.top)); + } + be_control_look->DrawScrollViewFrame(this, rect, updateRect, verticalScrollBarFrame, horizontalScrollBarFrame, base, fBorderStyle, flags); + return; } @@ -1960,7 +1973,7 @@ BColumnListView::_GetChildViewRects(const BRect& bounds, hScrollBarRect.right -= B_V_SCROLL_BAR_WIDTH; // Adjust stuff so the border will fit. - if (fBorderStyle == B_PLAIN_BORDER) { + if (fBorderStyle == B_PLAIN_BORDER || fBorderStyle == B_NO_BORDER) { titleRect.InsetBy(1, 0); titleRect.OffsetBy(0, 1); outlineRect.InsetBy(1, 1);