BColumnListView: Dynamic scrollbar size support.
Improves appearance on HiDPI.
This commit is contained in:
@@ -2148,18 +2148,21 @@ void
|
|||||||
BColumnListView::_GetChildViewRects(const BRect& bounds, BRect& titleRect,
|
BColumnListView::_GetChildViewRects(const BRect& bounds, BRect& titleRect,
|
||||||
BRect& outlineRect, BRect& vScrollBarRect, BRect& hScrollBarRect)
|
BRect& outlineRect, BRect& vScrollBarRect, BRect& hScrollBarRect)
|
||||||
{
|
{
|
||||||
|
const float vScrollBarWidth = be_control_look->GetScrollBarWidth(B_VERTICAL),
|
||||||
|
hScrollBarHeight = be_control_look->GetScrollBarWidth(B_HORIZONTAL);
|
||||||
|
|
||||||
titleRect = bounds;
|
titleRect = bounds;
|
||||||
titleRect.bottom = titleRect.top + std::max(kMinTitleHeight,
|
titleRect.bottom = titleRect.top + std::max(kMinTitleHeight,
|
||||||
ceilf(be_plain_font->Size() * kTitleSpacing));
|
ceilf(be_plain_font->Size() * kTitleSpacing));
|
||||||
#if !LOWER_SCROLLBAR
|
#if !LOWER_SCROLLBAR
|
||||||
titleRect.right -= B_V_SCROLL_BAR_WIDTH;
|
titleRect.right -= vScrollBarWidth;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
outlineRect = bounds;
|
outlineRect = bounds;
|
||||||
outlineRect.top = titleRect.bottom + 1.0;
|
outlineRect.top = titleRect.bottom + 1.0;
|
||||||
outlineRect.right -= B_V_SCROLL_BAR_WIDTH;
|
outlineRect.right -= vScrollBarWidth;
|
||||||
if (fShowingHorizontalScrollBar)
|
if (fShowingHorizontalScrollBar)
|
||||||
outlineRect.bottom -= B_H_SCROLL_BAR_HEIGHT;
|
outlineRect.bottom -= hScrollBarHeight;
|
||||||
|
|
||||||
vScrollBarRect = bounds;
|
vScrollBarRect = bounds;
|
||||||
#if LOWER_SCROLLBAR
|
#if LOWER_SCROLLBAR
|
||||||
@@ -2167,13 +2170,13 @@ BColumnListView::_GetChildViewRects(const BRect& bounds, BRect& titleRect,
|
|||||||
ceilf(be_plain_font->Size() * kTitleSpacing));
|
ceilf(be_plain_font->Size() * kTitleSpacing));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
vScrollBarRect.left = vScrollBarRect.right - B_V_SCROLL_BAR_WIDTH;
|
vScrollBarRect.left = vScrollBarRect.right - vScrollBarWidth;
|
||||||
if (fShowingHorizontalScrollBar)
|
if (fShowingHorizontalScrollBar)
|
||||||
vScrollBarRect.bottom -= B_H_SCROLL_BAR_HEIGHT;
|
vScrollBarRect.bottom -= hScrollBarHeight;
|
||||||
|
|
||||||
hScrollBarRect = bounds;
|
hScrollBarRect = bounds;
|
||||||
hScrollBarRect.top = hScrollBarRect.bottom - B_H_SCROLL_BAR_HEIGHT;
|
hScrollBarRect.top = hScrollBarRect.bottom - hScrollBarHeight;
|
||||||
hScrollBarRect.right -= B_V_SCROLL_BAR_WIDTH;
|
hScrollBarRect.right -= vScrollBarWidth;
|
||||||
|
|
||||||
// Adjust stuff so the border will fit.
|
// Adjust stuff so the border will fit.
|
||||||
if (fBorderStyle == B_PLAIN_BORDER || fBorderStyle == B_NO_BORDER) {
|
if (fBorderStyle == B_PLAIN_BORDER || fBorderStyle == B_NO_BORDER) {
|
||||||
|
|||||||
Reference in New Issue
Block a user