mmlr + stippi:

Fixed more controls to handle a B_TRANSPARENT_COLOR as view coloe of the
parent view. Some controls would not initialize their LowColor() at all
if they were the only control in a window.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26515 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2008-07-19 21:28:33 +00:00
parent 88ed5fc1d2
commit 54badb1f36
5 changed files with 32 additions and 22 deletions

View File

@ -273,9 +273,15 @@ BBox::Draw(BRect updateRect)
void
BBox::AttachedToWindow()
{
if (Parent()) {
SetViewColor(Parent()->ViewColor());
SetLowColor(Parent()->ViewColor());
BView* parent = Parent();
if (parent != NULL) {
// inherit the color from parent
rgb_color color = parent->ViewColor();
if (color == B_TRANSPARENT_COLOR)
color = ui_color(B_PANEL_BACKGROUND_COLOR);
SetViewColor(color);
SetLowColor(color);
}
// The box could have been resized in the mean time

View File

@ -142,9 +142,10 @@ BControl::WindowActivated(bool active)
void
BControl::AttachedToWindow()
{
if (Parent()) {
BView* parent = Parent();
if (parent != NULL) {
// inherit the color from parent
rgb_color color = Parent()->ViewColor();
rgb_color color = parent->ViewColor();
if (color == B_TRANSPARENT_COLOR)
color = ui_color(B_PANEL_BACKGROUND_COLOR);

View File

@ -280,9 +280,15 @@ BMenuField::Draw(BRect update)
void
BMenuField::AttachedToWindow()
{
if (Parent()) {
SetViewColor(Parent()->ViewColor());
SetLowColor(Parent()->ViewColor());
BView* parent = Parent();
if (parent != NULL) {
// inherit the color from parent
rgb_color color = parent->ViewColor();
if (color == B_TRANSPARENT_COLOR)
color = ui_color(B_PANEL_BACKGROUND_COLOR);
SetViewColor(color);
SetLowColor(color);
}
}

View File

@ -330,19 +330,9 @@ BSlider::AttachedToWindow()
BControl::AttachedToWindow();
BView* view = OffscreenView();
if (view) {
rgb_color color = ViewColor();
if (Parent() != NULL)
color = Parent()->ViewColor();
/* fOffScreenBits->Lock();
fOffScreenView->SetViewColor(color);
fOffScreenView->SetLowColor(color);
fOffScreenBits->Unlock();*/
view->LockLooper();
if (view && view->LockLooper()) {
view->SetViewColor(B_TRANSPARENT_COLOR);
view->SetLowColor(color);
view->SetLowColor(ViewColor());
view->UnlockLooper();
}

View File

@ -146,9 +146,16 @@ BStatusBar::AttachedToWindow()
ResizeTo(Bounds().Width(), height);
SetViewColor(B_TRANSPARENT_COLOR);
rgb_color lowColor = B_TRANSPARENT_COLOR;
if (Parent())
SetLowColor(Parent()->ViewColor());
BView* parent = Parent();
if (parent != NULL)
lowColor = parent->ViewColor();
if (lowColor == B_TRANSPARENT_COLOR)
lowColor = ui_color(B_PANEL_BACKGROUND_COLOR);
SetLowColor(lowColor);
fTextDivider = Bounds().Width();
}