In media preflet, update handling of nodes with no controls to look nicer and not make our window really small.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39149 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -624,21 +624,30 @@ MediaWindow::MessageReceived(BMessage* message)
|
|||||||
if (roster->GetParameterWebFor(*fCurrentNode, &fParamWeb)==B_OK
|
if (roster->GetParameterWebFor(*fCurrentNode, &fParamWeb)==B_OK
|
||||||
&& (paramView = BMediaTheme::PreferredTheme()->ViewFor(fParamWeb)) != NULL) {
|
&& (paramView = BMediaTheme::PreferredTheme()->ViewFor(fParamWeb)) != NULL) {
|
||||||
fContentView->AddChild(paramView);
|
fContentView->AddChild(paramView);
|
||||||
paramView->ResizeTo(fContentView->Bounds().Width(), fContentView->Bounds().Height() - 10);
|
paramView->ResizeTo(1, 1);
|
||||||
|
// make sure we don't get stuck with a very large
|
||||||
|
// paramView
|
||||||
roster->StartWatching(this, *fCurrentNode, B_MEDIA_WILDCARD);
|
roster->StartWatching(this, *fCurrentNode, B_MEDIA_WILDCARD);
|
||||||
} else {
|
} else {
|
||||||
delete fParamWeb;
|
delete fParamWeb;
|
||||||
fParamWeb = NULL;
|
fParamWeb = NULL;
|
||||||
|
|
||||||
BRect bounds = fContentView->Bounds();
|
BStringView* stringView = new BStringView("noControls",
|
||||||
BStringView* stringView = new BStringView(bounds,
|
B_TRANSLATE("This hardware has no controls."));
|
||||||
"noControls", B_TRANSLATE("This hardware has no controls."),
|
|
||||||
B_FOLLOW_V_CENTER | B_FOLLOW_H_CENTER);
|
BSize unlimited(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED);
|
||||||
stringView->ResizeToPreferred();
|
stringView->SetExplicitMaxSize(unlimited);
|
||||||
|
|
||||||
|
BAlignment centered(B_ALIGN_HORIZONTAL_CENTER,
|
||||||
|
B_ALIGN_VERTICAL_CENTER);
|
||||||
|
stringView->SetExplicitAlignment(centered);
|
||||||
|
stringView->SetAlignment(B_ALIGN_CENTER);
|
||||||
|
|
||||||
fContentView->AddChild(stringView);
|
fContentView->AddChild(stringView);
|
||||||
stringView->MoveBy((bounds.Width()-stringView->Bounds().Width())/2,
|
|
||||||
(bounds.Height()-stringView->Bounds().Height())/2);
|
rgb_color panel = stringView->LowColor();
|
||||||
|
stringView->SetHighColor(tint_color(panel,
|
||||||
|
B_DISABLED_LABEL_TINT));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user