diff --git a/application/ChatWindow.cpp b/application/ChatWindow.cpp index f331c48..b3fac13 100644 --- a/application/ChatWindow.cpp +++ b/application/ChatWindow.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -65,8 +66,6 @@ ChatWindow::ChatWindow(ContactLinker* cl) fStatus = new BStringView("status", ""); fStatus->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE)); - SetLayout(new BGroupLayout(B_HORIZONTAL)); - fAvatar = new BitmapView("ContactIcon"); fAvatar->SetExplicitMaxSize(BSize(50, 50)); fAvatar->SetExplicitMinSize(BSize(50, 50)); @@ -78,17 +77,18 @@ ChatWindow::ChatWindow(ContactLinker* cl) BitmapView* protocolView = new BitmapView("protocolView"); protocolView->SetBitmap(protocolBitmap); - AddChild(BGroupLayoutBuilder(B_VERTICAL, 10) + BLayoutBuilder::Group<>(this, B_VERTICAL, 10) .AddGroup(B_HORIZONTAL) .Add(protocolView) .Add(fPersonalMessage) .Add(fAvatar) .End() - .Add(scrollViewReceive, 2) - .Add(scrollViewSend, 3) + .AddSplit(B_VERTICAL) + .Add(scrollViewReceive, 2) + .Add(scrollViewSend, 3) + .End() .Add(fStatus, 4) - .SetInsets(5, 5, 5, 5) - ); + .SetInsets(5, 5, 5, 5); MoveTo(BAlert::AlertPosition(Bounds().Width(), Bounds().Height() / 2)); diff --git a/libs/libinterface/BitmapView.cpp b/libs/libinterface/BitmapView.cpp index 89a50c2..793635d 100644 --- a/libs/libinterface/BitmapView.cpp +++ b/libs/libinterface/BitmapView.cpp @@ -39,7 +39,10 @@ void BitmapView::AttachedToWindow() { // Set view color to parent's view color - SetViewColor(Parent()->ViewColor()); + if (Parent() != NULL) + SetViewColor(Parent()->ViewColor()); + else + SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); }