ColumnListView: Remove pre-ControlLook drawing code
This commit is contained in:
@@ -1786,7 +1786,6 @@ BColumnListView::Draw(BRect updateRect)
|
|||||||
{
|
{
|
||||||
BRect rect = Bounds();
|
BRect rect = Bounds();
|
||||||
|
|
||||||
if (be_control_look != NULL) {
|
|
||||||
uint32 flags = 0;
|
uint32 flags = 0;
|
||||||
if (IsFocus() && Window()->IsActive())
|
if (IsFocus() && Window()->IsActive())
|
||||||
flags |= BControlLook::B_FOCUSED;
|
flags |= BControlLook::B_FOCUSED;
|
||||||
@@ -1796,6 +1795,7 @@ BColumnListView::Draw(BRect updateRect)
|
|||||||
BRect verticalScrollBarFrame;
|
BRect verticalScrollBarFrame;
|
||||||
if (!fVerticalScrollBar->IsHidden())
|
if (!fVerticalScrollBar->IsHidden())
|
||||||
verticalScrollBarFrame = fVerticalScrollBar->Frame();
|
verticalScrollBarFrame = fVerticalScrollBar->Frame();
|
||||||
|
|
||||||
BRect horizontalScrollBarFrame;
|
BRect horizontalScrollBarFrame;
|
||||||
if (!fHorizontalScrollBar->IsHidden())
|
if (!fHorizontalScrollBar->IsHidden())
|
||||||
horizontalScrollBarFrame = fHorizontalScrollBar->Frame();
|
horizontalScrollBarFrame = fHorizontalScrollBar->Frame();
|
||||||
@@ -1825,39 +1825,6 @@ BColumnListView::Draw(BRect updateRect)
|
|||||||
be_control_look->DrawScrollViewFrame(this, rect, updateRect,
|
be_control_look->DrawScrollViewFrame(this, rect, updateRect,
|
||||||
BRect(), BRect(), base, fBorderStyle, flags);
|
BRect(), BRect(), base, fBorderStyle, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
BRect cornerRect(rect.right - B_V_SCROLL_BAR_WIDTH,
|
|
||||||
rect.bottom - B_H_SCROLL_BAR_HEIGHT, rect.right, rect.bottom);
|
|
||||||
if (fBorderStyle == B_PLAIN_BORDER) {
|
|
||||||
BView::SetHighColor(0, 0, 0);
|
|
||||||
StrokeRect(rect);
|
|
||||||
cornerRect.OffsetBy(-1, -1);
|
|
||||||
} else if (fBorderStyle == B_FANCY_BORDER) {
|
|
||||||
bool isFocus = IsFocus() && Window()->IsActive();
|
|
||||||
|
|
||||||
if (isFocus) {
|
|
||||||
// TODO: Need to find focus color programatically
|
|
||||||
BView::SetHighColor(0, 0, 190);
|
|
||||||
} else
|
|
||||||
BView::SetHighColor(255, 255, 255);
|
|
||||||
|
|
||||||
StrokeRect(rect);
|
|
||||||
if (!isFocus)
|
|
||||||
BView::SetHighColor(184, 184, 184);
|
|
||||||
else
|
|
||||||
BView::SetHighColor(152, 152, 152);
|
|
||||||
|
|
||||||
rect.InsetBy(1,1);
|
|
||||||
StrokeRect(rect);
|
|
||||||
cornerRect.OffsetBy(-2, -2);
|
|
||||||
}
|
|
||||||
|
|
||||||
BView::SetHighColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
|
||||||
// fills lower right rect between scroll bars
|
|
||||||
FillRect(cornerRect);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2509,35 +2476,7 @@ TitleView::DrawTitle(BView* view, BRect rect, BColumn* column, bool depressed)
|
|||||||
rgb_color borderColor = mix_color(
|
rgb_color borderColor = mix_color(
|
||||||
fMasterView->Color(B_COLOR_HEADER_BACKGROUND),
|
fMasterView->Color(B_COLOR_HEADER_BACKGROUND),
|
||||||
make_color(0, 0, 0), 128);
|
make_color(0, 0, 0), 128);
|
||||||
rgb_color backgroundColor;
|
|
||||||
|
|
||||||
rgb_color bevelHigh;
|
|
||||||
rgb_color bevelLow;
|
|
||||||
// Want exterior borders to overlap.
|
|
||||||
if (be_control_look == NULL) {
|
|
||||||
rect.right += 1;
|
|
||||||
drawRect = rect;
|
drawRect = rect;
|
||||||
drawRect.InsetBy(2, 2);
|
|
||||||
if (depressed) {
|
|
||||||
backgroundColor = mix_color(
|
|
||||||
fMasterView->Color(B_COLOR_HEADER_BACKGROUND),
|
|
||||||
make_color(0, 0, 0), 64);
|
|
||||||
bevelHigh = mix_color(backgroundColor, make_color(0, 0, 0), 64);
|
|
||||||
bevelLow = mix_color(backgroundColor, make_color(255, 255, 255),
|
|
||||||
128);
|
|
||||||
drawRect.left++;
|
|
||||||
drawRect.top++;
|
|
||||||
} else {
|
|
||||||
backgroundColor = fMasterView->Color(B_COLOR_HEADER_BACKGROUND);
|
|
||||||
bevelHigh = mix_color(backgroundColor, make_color(255, 255, 255),
|
|
||||||
192);
|
|
||||||
bevelLow = mix_color(backgroundColor, make_color(0, 0, 0), 64);
|
|
||||||
drawRect.bottom--;
|
|
||||||
drawRect.right--;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
drawRect = rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
font_height fh;
|
font_height fh;
|
||||||
GetFontHeight(&fh);
|
GetFontHeight(&fh);
|
||||||
@@ -2545,7 +2484,6 @@ TitleView::DrawTitle(BView* view, BRect rect, BColumn* column, bool depressed)
|
|||||||
float baseline = floor(drawRect.top + fh.ascent
|
float baseline = floor(drawRect.top + fh.ascent
|
||||||
+ (drawRect.Height() + 1 - (fh.ascent + fh.descent)) / 2);
|
+ (drawRect.Height() + 1 - (fh.ascent + fh.descent)) / 2);
|
||||||
|
|
||||||
if (be_control_look != NULL) {
|
|
||||||
BRect bgRect = rect;
|
BRect bgRect = rect;
|
||||||
|
|
||||||
rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
|
rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
|
||||||
@@ -2565,29 +2503,8 @@ TitleView::DrawTitle(BView* view, BRect rect, BColumn* column, bool depressed)
|
|||||||
B_DARKEN_2_TINT));
|
B_DARKEN_2_TINT));
|
||||||
view->StrokeLine(rect.RightTop(), rect.RightBottom());
|
view->StrokeLine(rect.RightTop(), rect.RightBottom());
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
view->SetHighColor(borderColor);
|
|
||||||
view->StrokeRect(rect);
|
|
||||||
view->BeginLineArray(4);
|
|
||||||
view->AddLine(BPoint(rect.left + 1, rect.top + 1),
|
|
||||||
BPoint(rect.right - 1, rect.top + 1), bevelHigh);
|
|
||||||
view->AddLine(BPoint(rect.left + 1, rect.top + 1),
|
|
||||||
BPoint(rect.left + 1, rect.bottom - 1), bevelHigh);
|
|
||||||
view->AddLine(BPoint(rect.right - 1, rect.top + 1),
|
|
||||||
BPoint(rect.right - 1, rect.bottom - 1), bevelLow);
|
|
||||||
view->AddLine(BPoint(rect.left + 2, rect.bottom-1),
|
|
||||||
BPoint(rect.right - 1, rect.bottom - 1), bevelLow);
|
|
||||||
view->EndLineArray();
|
|
||||||
|
|
||||||
view->SetHighColor(backgroundColor);
|
|
||||||
view->SetLowColor(backgroundColor);
|
|
||||||
|
|
||||||
view->FillRect(rect.InsetByCopy(2, 2));
|
|
||||||
}
|
|
||||||
|
|
||||||
// If no column given, nothing else to draw.
|
// If no column given, nothing else to draw.
|
||||||
if (!column)
|
if (column == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
view->SetHighColor(fMasterView->Color(B_COLOR_HEADER_TEXT));
|
view->SetHighColor(fMasterView->Color(B_COLOR_HEADER_TEXT));
|
||||||
|
|||||||
Reference in New Issue
Block a user