BColorControl: Rename bevelRect to just rect
... with an explanatory comment. Correct similar comment. Tiny style fix.
This commit is contained in:
parent
62fec205dd
commit
abbd44acfb
@ -198,7 +198,7 @@ BColorControl::_LayoutView()
|
|||||||
}
|
}
|
||||||
|
|
||||||
BRect rect = fPaletteFrame.InsetByCopy(-kBevelSpacing, -kBevelSpacing);
|
BRect rect = fPaletteFrame.InsetByCopy(-kBevelSpacing, -kBevelSpacing);
|
||||||
// frame not including bevel
|
// frame including bevel
|
||||||
|
|
||||||
if (rect.Height() < fBlueText->Frame().bottom)
|
if (rect.Height() < fBlueText->Frame().bottom)
|
||||||
rect.bottom = fBlueText->Frame().bottom;
|
rect.bottom = fBlueText->Frame().bottom;
|
||||||
@ -417,7 +417,8 @@ BColorControl::Draw(BRect updateRect)
|
|||||||
void
|
void
|
||||||
BColorControl::_DrawColorArea(BView* target, BRect updateRect)
|
BColorControl::_DrawColorArea(BView* target, BRect updateRect)
|
||||||
{
|
{
|
||||||
BRect bevelRect = fPaletteFrame.InsetByCopy(-kBevelSpacing, -kBevelSpacing);
|
BRect rect = fPaletteFrame.InsetByCopy(-kBevelSpacing, -kBevelSpacing);
|
||||||
|
// frame including bevel
|
||||||
bool enabled = IsEnabled();
|
bool enabled = IsEnabled();
|
||||||
|
|
||||||
rgb_color noTint = ui_color(B_PANEL_BACKGROUND_COLOR);
|
rgb_color noTint = ui_color(B_PANEL_BACKGROUND_COLOR);
|
||||||
@ -428,8 +429,8 @@ BColorControl::_DrawColorArea(BView* target, BRect updateRect)
|
|||||||
if (!enabled)
|
if (!enabled)
|
||||||
flags |= BControlLook::B_DISABLED;
|
flags |= BControlLook::B_DISABLED;
|
||||||
|
|
||||||
be_control_look->DrawTextControlBorder(target, bevelRect, updateRect,
|
be_control_look->DrawTextControlBorder(target, rect, updateRect, noTint,
|
||||||
noTint, flags);
|
flags);
|
||||||
} else {
|
} else {
|
||||||
rgb_color lighten1 = tint_color(noTint, B_LIGHTEN_1_TINT);
|
rgb_color lighten1 = tint_color(noTint, B_LIGHTEN_1_TINT);
|
||||||
rgb_color lightenmax = tint_color(noTint, B_LIGHTEN_MAX_TINT);
|
rgb_color lightenmax = tint_color(noTint, B_LIGHTEN_MAX_TINT);
|
||||||
@ -442,19 +443,19 @@ BColorControl::_DrawColorArea(BView* target, BRect updateRect)
|
|||||||
else
|
else
|
||||||
target->SetHighColor(noTint);
|
target->SetHighColor(noTint);
|
||||||
|
|
||||||
target->StrokeLine(bevelRect.LeftBottom(), bevelRect.LeftTop());
|
target->StrokeLine(rect.LeftBottom(), rect.LeftTop());
|
||||||
target->StrokeLine(bevelRect.LeftTop(), bevelRect.RightTop());
|
target->StrokeLine(rect.LeftTop(), rect.RightTop());
|
||||||
if (enabled)
|
if (enabled)
|
||||||
target->SetHighColor(lightenmax);
|
target->SetHighColor(lightenmax);
|
||||||
else
|
else
|
||||||
target->SetHighColor(lighten1);
|
target->SetHighColor(lighten1);
|
||||||
|
|
||||||
target->StrokeLine(BPoint(bevelRect.left + 1.0f, bevelRect.bottom),
|
target->StrokeLine(BPoint(rect.left + 1.0f, rect.bottom),
|
||||||
bevelRect.RightBottom());
|
rect.RightBottom());
|
||||||
target->StrokeLine(bevelRect.RightBottom(),
|
target->StrokeLine(rect.RightBottom(),
|
||||||
BPoint(bevelRect.right, bevelRect.top + 1.0f));
|
BPoint(rect.right, rect.top + 1.0f));
|
||||||
|
|
||||||
bevelRect.InsetBy(1.0f, 1.0f);
|
rect.InsetBy(1.0f, 1.0f);
|
||||||
|
|
||||||
// second bevel
|
// second bevel
|
||||||
if (enabled)
|
if (enabled)
|
||||||
@ -462,13 +463,13 @@ BColorControl::_DrawColorArea(BView* target, BRect updateRect)
|
|||||||
else
|
else
|
||||||
target->SetHighColor(darken2);
|
target->SetHighColor(darken2);
|
||||||
|
|
||||||
target->StrokeLine(bevelRect.LeftBottom(), bevelRect.LeftTop());
|
target->StrokeLine(rect.LeftBottom(), rect.LeftTop());
|
||||||
target->StrokeLine(bevelRect.LeftTop(), bevelRect.RightTop());
|
target->StrokeLine(rect.LeftTop(), rect.RightTop());
|
||||||
target->SetHighColor(noTint);
|
target->SetHighColor(noTint);
|
||||||
target->StrokeLine(BPoint(bevelRect.left + 1.0f, bevelRect.bottom),
|
target->StrokeLine(BPoint(rect.left + 1.0f, rect.bottom),
|
||||||
bevelRect.RightBottom());
|
rect.RightBottom());
|
||||||
target->StrokeLine(bevelRect.RightBottom(),
|
target->StrokeLine(rect.RightBottom(),
|
||||||
BPoint(bevelRect.right, bevelRect.top + 1.0f));
|
BPoint(rect.right, rect.top + 1.0f));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fPaletteMode) {
|
if (fPaletteMode) {
|
||||||
@ -485,12 +486,12 @@ BColorControl::_DrawColorArea(BView* target, BRect updateRect)
|
|||||||
else
|
else
|
||||||
target->SetHighColor(noTint);
|
target->SetHighColor(noTint);
|
||||||
|
|
||||||
for (int xi = 0; xi < fColumns+1; xi++) {
|
for (int xi = 0; xi < fColumns + 1; xi++) {
|
||||||
float x = fPaletteFrame.left + float(xi) * fCellSize;
|
float x = fPaletteFrame.left + float(xi) * fCellSize;
|
||||||
target->StrokeLine(BPoint(x, fPaletteFrame.top),
|
target->StrokeLine(BPoint(x, fPaletteFrame.top),
|
||||||
BPoint(x, fPaletteFrame.bottom));
|
BPoint(x, fPaletteFrame.bottom));
|
||||||
}
|
}
|
||||||
for (int yi = 0; yi < fRows+1; yi++) {
|
for (int yi = 0; yi < fRows + 1; yi++) {
|
||||||
float y = fPaletteFrame.top + float(yi) * fCellSize;
|
float y = fPaletteFrame.top + float(yi) * fCellSize;
|
||||||
target->StrokeLine(BPoint(fPaletteFrame.left, y),
|
target->StrokeLine(BPoint(fPaletteFrame.left, y),
|
||||||
BPoint(fPaletteFrame.right, y));
|
BPoint(fPaletteFrame.right, y));
|
||||||
|
Loading…
Reference in New Issue
Block a user