* Used ui_color() for default view color.

* Fixed Track and Disc time labels to be large enough. (Fixes #2201.)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25412 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2008-05-10 11:27:48 +00:00
parent 901e5756cb
commit d77a8d47d2

View File

@ -74,7 +74,7 @@ CDPlayer::CDPlayer(BRect frame, const char *name, uint32 resizeMask,
: BView(frame, name, resizeMask, flags | B_FRAME_EVENTS), : BView(frame, name, resizeMask, flags | B_FRAME_EVENTS),
fCDQuery("freedb.freedb.org") fCDQuery("freedb.freedb.org")
{ {
SetViewColor(216, 216, 216); SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
fVolume = 255; fVolume = 255;
@ -139,18 +139,22 @@ CDPlayer::BuildGUI()
r.OffsetBy(0, r.Height() + 5); r.OffsetBy(0, r.Height() + 5);
r.right = r.left + (r.Width() / 2); r.right = r.left + (r.Width() / 2);
fTrackTime = new BStringView(r, "TrackTime", "Track: --:-- / --:--", fTrackTime = new BStringView(r, "TrackTime", "Track: 88:88 / 88:88",
B_FOLLOW_LEFT_RIGHT); B_FOLLOW_LEFT_RIGHT);
fTrackTime->ResizeToPreferred();
fTrackTime->SetText("Track: --:-- / --:--");
box->AddChild(fTrackTime); box->AddChild(fTrackTime);
r.OffsetTo(box->Bounds().right / 2, r.top); r.OffsetTo(fTrackTime->Frame().right + 5, r.top);
fDiscTime = new BStringView(r, "DiscTime", "Disc: --:-- / --:--", fDiscTime = new BStringView(r, "DiscTime", "Disc: 88:88 / 88:88",
B_FOLLOW_RIGHT); B_FOLLOW_RIGHT);
fDiscTime->ResizeToPreferred(); fDiscTime->ResizeToPreferred();
fDiscTime->ResizeBy(10, 0); fDiscTime->SetText("Disc: --:-- / --:--");
box->AddChild(fDiscTime); box->AddChild(fDiscTime);
box->ResizeTo(fCDTitle->Frame().right + 5, fDiscTime->Frame().bottom + 10); float maxWidth = max_c(fDiscTime->Frame().right, fCDTitle->Frame().right);
box->ResizeTo(maxWidth + 5, fDiscTime->Frame().bottom + 10);
fStop = new DrawButton(BRect(0, 0, 1, 1), "Stop", fStop = new DrawButton(BRect(0, 0, 1, 1), "Stop",
BTranslationUtils::GetBitmap(B_PNG_FORMAT, "stop_up"), BTranslationUtils::GetBitmap(B_PNG_FORMAT, "stop_up"),