Interface Kit: Remove more non-BControlLook code.
This commit is contained in:
@@ -349,7 +349,6 @@ _BMCMenuBar_::_Init()
|
||||
bottom--;
|
||||
#endif
|
||||
|
||||
if (be_control_look != NULL)
|
||||
left = right = be_control_look->DefaultLabelSpacing();
|
||||
|
||||
SetItemMargins(left, top,
|
||||
|
||||
@@ -679,13 +679,8 @@ BBox::_DrawPlain(BRect labelBox)
|
||||
|
||||
float lightTint;
|
||||
float shadowTint;
|
||||
if (be_control_look != NULL) {
|
||||
lightTint = B_LIGHTEN_1_TINT;
|
||||
shadowTint = B_DARKEN_1_TINT;
|
||||
} else {
|
||||
lightTint = B_LIGHTEN_MAX_TINT;
|
||||
shadowTint = B_DARKEN_3_TINT;
|
||||
}
|
||||
|
||||
if (rect.Height() == 0.0 || rect.Width() == 0.0) {
|
||||
// used as separator
|
||||
@@ -718,7 +713,6 @@ BBox::_DrawFancy(BRect labelBox)
|
||||
BRect rect = Bounds();
|
||||
rect.top += TopBorderOffset();
|
||||
|
||||
if (be_control_look != NULL) {
|
||||
rgb_color base = ViewColor();
|
||||
if (rect.Height() == 1.0) {
|
||||
// used as horizontal separator
|
||||
@@ -732,52 +726,6 @@ BBox::_DrawFancy(BRect labelBox)
|
||||
// used as box
|
||||
be_control_look->DrawGroupFrame(this, rect, rect, base);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
rgb_color light = tint_color(ViewColor(), B_LIGHTEN_MAX_TINT);
|
||||
rgb_color shadow = tint_color(ViewColor(), B_DARKEN_3_TINT);
|
||||
|
||||
if (rect.Height() == 1.0) {
|
||||
// used as horizontal separator
|
||||
BeginLineArray(2);
|
||||
AddLine(BPoint(rect.left, rect.top),
|
||||
BPoint(rect.right, rect.top), shadow);
|
||||
AddLine(BPoint(rect.left, rect.bottom),
|
||||
BPoint(rect.right, rect.bottom), light);
|
||||
EndLineArray();
|
||||
} else if (rect.Width() == 1.0) {
|
||||
// used as vertical separator
|
||||
BeginLineArray(2);
|
||||
AddLine(BPoint(rect.left, rect.top),
|
||||
BPoint(rect.left, rect.bottom), shadow);
|
||||
AddLine(BPoint(rect.right, rect.top),
|
||||
BPoint(rect.right, rect.bottom), light);
|
||||
EndLineArray();
|
||||
} else {
|
||||
// used as box
|
||||
BeginLineArray(8);
|
||||
AddLine(BPoint(rect.left, rect.bottom - 1.0),
|
||||
BPoint(rect.left, rect.top), shadow);
|
||||
AddLine(BPoint(rect.left + 1.0, rect.top),
|
||||
BPoint(rect.right - 1.0, rect.top), shadow);
|
||||
AddLine(BPoint(rect.left, rect.bottom),
|
||||
BPoint(rect.right, rect.bottom), light);
|
||||
AddLine(BPoint(rect.right, rect.bottom - 1.0),
|
||||
BPoint(rect.right, rect.top), light);
|
||||
|
||||
rect.InsetBy(1.0, 1.0);
|
||||
|
||||
AddLine(BPoint(rect.left, rect.bottom - 1.0),
|
||||
BPoint(rect.left, rect.top), light);
|
||||
AddLine(BPoint(rect.left + 1.0, rect.top),
|
||||
BPoint(rect.right - 1.0, rect.top), light);
|
||||
AddLine(BPoint(rect.left, rect.bottom),
|
||||
BPoint(rect.right, rect.bottom), shadow);
|
||||
AddLine(BPoint(rect.right, rect.bottom - 1.0),
|
||||
BPoint(rect.right, rect.top), shadow);
|
||||
EndLineArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -430,40 +430,9 @@ BColorControl::_DrawColorArea(BView* target, BRect updateRect)
|
||||
rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
|
||||
rgb_color darken1 = tint_color(base, B_DARKEN_1_TINT);
|
||||
|
||||
if (be_control_look != NULL) {
|
||||
uint32 flags = be_control_look->Flags(this);
|
||||
be_control_look->DrawTextControlBorder(target, rect, updateRect,
|
||||
base, flags);
|
||||
} else {
|
||||
// first bevel
|
||||
rgb_color lighten1 = tint_color(base, B_LIGHTEN_1_TINT);
|
||||
rgb_color lightenmax = tint_color(base, B_LIGHTEN_MAX_TINT);
|
||||
target->SetHighColor(enabled ? darken1 : base);
|
||||
|
||||
target->StrokeLine(rect.LeftBottom(), rect.LeftTop());
|
||||
target->StrokeLine(rect.LeftTop(), rect.RightTop());
|
||||
target->SetHighColor(enabled ? lightenmax : lighten1);
|
||||
|
||||
target->StrokeLine(BPoint(rect.left + 1.0f, rect.bottom),
|
||||
rect.RightBottom());
|
||||
target->StrokeLine(rect.RightBottom(),
|
||||
BPoint(rect.right, rect.top + 1.0f));
|
||||
|
||||
rect.InsetBy(1.0f, 1.0f);
|
||||
|
||||
// second bevel
|
||||
rgb_color darken2 = tint_color(base, B_DARKEN_2_TINT);
|
||||
rgb_color darken4 = tint_color(base, B_DARKEN_4_TINT);
|
||||
target->SetHighColor(enabled ? darken4 : darken2);
|
||||
|
||||
target->StrokeLine(rect.LeftBottom(), rect.LeftTop());
|
||||
target->StrokeLine(rect.LeftTop(), rect.RightTop());
|
||||
target->SetHighColor(base);
|
||||
target->StrokeLine(BPoint(rect.left + 1.0f, rect.bottom),
|
||||
rect.RightBottom());
|
||||
target->StrokeLine(rect.RightBottom(),
|
||||
BPoint(rect.right, rect.top + 1.0f));
|
||||
}
|
||||
|
||||
if (fPaletteMode) {
|
||||
int colBegin = max_c(0, -1 + int(updateRect.left) / int(fCellSize));
|
||||
|
||||
@@ -1407,7 +1407,6 @@ BMenu::AddDynamicItem(add_state state)
|
||||
void
|
||||
BMenu::DrawBackground(BRect updateRect)
|
||||
{
|
||||
if (be_control_look != NULL) {
|
||||
rgb_color base = ui_color(B_MENU_BACKGROUND_COLOR);
|
||||
uint32 flags = 0;
|
||||
if (!IsEnabled())
|
||||
@@ -1431,14 +1430,6 @@ BMenu::DrawBackground(BRect updateRect)
|
||||
}
|
||||
be_control_look->DrawMenuBackground(this, rect, updateRect, base, 0,
|
||||
borders);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
rgb_color oldColor = HighColor();
|
||||
SetHighColor(ui_color(B_MENU_BACKGROUND_COLOR));
|
||||
FillRect(Bounds() & updateRect, B_SOLID_HIGH);
|
||||
SetHighColor(oldColor);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -541,7 +541,6 @@ BScrollView::SetBorderHighlighted(bool highlight)
|
||||
fVerticalScrollBar->SetBorderHighlighted(highlight);
|
||||
|
||||
BRect bounds = Bounds();
|
||||
if (be_control_look != NULL)
|
||||
bounds.InsetBy(1, 1);
|
||||
|
||||
Invalidate(BRect(bounds.left, bounds.top, bounds.right, bounds.top));
|
||||
@@ -737,7 +736,6 @@ BScrollView::_Init(bool horizontal, bool vertical)
|
||||
fHighlighted = false;
|
||||
fBorders = BControlLook::B_ALL_BORDERS;
|
||||
|
||||
if (be_control_look != NULL)
|
||||
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||
|
||||
if (horizontal) {
|
||||
|
||||
@@ -345,59 +345,8 @@ BStatusBar::Draw(BRect updateRect)
|
||||
|
||||
rect = outerFrame;
|
||||
|
||||
if (be_control_look != NULL) {
|
||||
be_control_look->DrawStatusBar(this, rect, updateRect,
|
||||
backgroundColor, fBarColor, _BarPosition(barFrame));
|
||||
return;
|
||||
}
|
||||
|
||||
// First bevel
|
||||
SetHighColor(tint_color(backgroundColor, B_DARKEN_1_TINT));
|
||||
StrokeLine(rect.LeftBottom(), rect.LeftTop());
|
||||
StrokeLine(rect.RightTop());
|
||||
|
||||
SetHighColor(tint_color(backgroundColor, B_LIGHTEN_2_TINT));
|
||||
StrokeLine(BPoint(rect.left + 1, rect.bottom), rect.RightBottom());
|
||||
StrokeLine(BPoint(rect.right, rect.top + 1));
|
||||
|
||||
rect.InsetBy(1, 1);
|
||||
|
||||
// Second bevel
|
||||
SetHighColor(tint_color(backgroundColor, B_DARKEN_4_TINT));
|
||||
StrokeLine(rect.LeftBottom(), rect.LeftTop());
|
||||
StrokeLine(rect.RightTop());
|
||||
|
||||
SetHighColor(backgroundColor);
|
||||
StrokeLine(BPoint(rect.left + 1, rect.bottom), rect.RightBottom());
|
||||
StrokeLine(BPoint(rect.right, rect.top + 1));
|
||||
|
||||
rect = barFrame;
|
||||
rect.right = _BarPosition(barFrame);
|
||||
|
||||
// draw bar itself
|
||||
|
||||
if (rect.right >= rect.left) {
|
||||
// Bevel
|
||||
SetHighColor(tint_color(fBarColor, B_LIGHTEN_2_TINT));
|
||||
StrokeLine(rect.LeftBottom(), rect.LeftTop());
|
||||
StrokeLine(rect.RightTop());
|
||||
|
||||
SetHighColor(tint_color(fBarColor, B_DARKEN_2_TINT));
|
||||
StrokeLine(BPoint(rect.left + 1, rect.bottom), rect.RightBottom());
|
||||
StrokeLine(BPoint(rect.right, rect.top + 1));
|
||||
|
||||
// filling
|
||||
SetHighColor(fBarColor);
|
||||
FillRect(rect.InsetByCopy(1, 1));
|
||||
}
|
||||
|
||||
if (rect.right < barFrame.right) {
|
||||
// empty space
|
||||
rect.left = rect.right + 1;
|
||||
rect.right = barFrame.right;
|
||||
SetHighColor(tint_color(backgroundColor, B_LIGHTEN_MAX_TINT));
|
||||
FillRect(rect);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -595,7 +544,6 @@ BStatusBar::SetTo(float value, const char* text, const char* trailingText)
|
||||
}
|
||||
|
||||
// TODO: Ask the BControlLook in the first place about dirty rect.
|
||||
if (be_control_look != NULL)
|
||||
update.InsetBy(-1, -1);
|
||||
|
||||
Invalidate(update);
|
||||
|
||||
@@ -176,7 +176,6 @@ _BTextInput_::AlignTextRect()
|
||||
float hInset = 2;
|
||||
float textFontWidth = TextRect().right;
|
||||
|
||||
if (be_control_look != NULL) {
|
||||
switch (Alignment()) {
|
||||
case B_ALIGN_LEFT:
|
||||
hInset = be_control_look->DefaultLabelSpacing();
|
||||
@@ -194,7 +193,6 @@ _BTextInput_::AlignTextRect()
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
textRect.InsetBy(hInset, vInset);
|
||||
SetTextRect(textRect);
|
||||
|
||||
Reference in New Issue
Block a user