Added support for the B_HIDDEN_PARAMETER flag.
Added heuristica to only show those BNullParameters which the original media kit shows. Removed flickering in the SeparatorView drawing code. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3800 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
652243dade
commit
c81f1c978f
@ -52,10 +52,33 @@ class TitleView : public BView {
|
|||||||
} // namespace BPrivate
|
} // namespace BPrivate
|
||||||
|
|
||||||
|
|
||||||
|
static bool
|
||||||
|
parameter_should_be_hidden(BParameter ¶meter)
|
||||||
|
{
|
||||||
|
// ToDo: note, this is probably completely stupid, but it's the only
|
||||||
|
// way I could safely remove the null parameters that are not shown
|
||||||
|
// by the R5 media theme
|
||||||
|
if (parameter.Type() != BParameter::B_NULL_PARAMETER
|
||||||
|
|| strcmp(parameter.Kind(), B_WEB_PHYSICAL_INPUT))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (int32 i = 0; i < parameter.CountOutputs(); i++) {
|
||||||
|
if (!strcmp(parameter.OutputAt(0)->Kind(), B_INPUT_MUX))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
SeparatorView::SeparatorView(BRect frame)
|
SeparatorView::SeparatorView(BRect frame)
|
||||||
: BView(frame, "-", B_FOLLOW_NONE, B_WILL_DRAW)
|
: BView(frame, "-", B_FOLLOW_NONE, B_WILL_DRAW)
|
||||||
{
|
{
|
||||||
fVertical = frame.Width() < frame.Height();
|
fVertical = frame.Width() < frame.Height();
|
||||||
|
SetViewColor(B_TRANSPARENT_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -217,6 +240,9 @@ DefaultMediaTheme::MakeViewFor(BParameterGroup &group, const BRect &hintRect)
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
|
if (group.Flags() & B_HIDDEN_PARAMETER)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
BRect rect(hintRect);
|
BRect rect(hintRect);
|
||||||
BBox *view = new BBox(rect, group.Name());
|
BBox *view = new BBox(rect, group.Name());
|
||||||
view->SetBorder(B_NO_BORDER);
|
view->SetBorder(B_NO_BORDER);
|
||||||
@ -309,10 +335,8 @@ DefaultMediaTheme::MakeViewFor(BParameterGroup &group, const BRect &hintRect)
|
|||||||
subView->MoveTo((width - frame.Width()) / 2, frame.top);
|
subView->MoveTo((width - frame.Width()) / 2, frame.top);
|
||||||
else {
|
else {
|
||||||
// tweak the PopUp views to look better
|
// tweak the PopUp views to look better
|
||||||
if (dynamic_cast<BOptionPopUp *>(subView) != NULL) {
|
if (dynamic_cast<BOptionPopUp *>(subView) != NULL)
|
||||||
subView->ResizeTo(width, frame.Height());
|
subView->ResizeTo(width, frame.Height());
|
||||||
//subView->SetDivider(10);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,6 +351,10 @@ DefaultMediaTheme::MakeViewFor(BParameterGroup &group, const BRect &hintRect)
|
|||||||
BView *
|
BView *
|
||||||
DefaultMediaTheme::MakeSelfHostingViewFor(BParameter ¶meter, const BRect &hintRect)
|
DefaultMediaTheme::MakeSelfHostingViewFor(BParameter ¶meter, const BRect &hintRect)
|
||||||
{
|
{
|
||||||
|
if (parameter.Flags() & B_HIDDEN_PARAMETER
|
||||||
|
|| parameter_should_be_hidden(parameter))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
BView *view = MakeViewFor(¶meter, &hintRect);
|
BView *view = MakeViewFor(¶meter, &hintRect);
|
||||||
if (view == NULL) {
|
if (view == NULL) {
|
||||||
// The MakeViewFor() method above returns a BControl - which we
|
// The MakeViewFor() method above returns a BControl - which we
|
||||||
|
Loading…
Reference in New Issue
Block a user