diff --git a/src/kits/interface/ChannelControl.cpp b/src/kits/interface/ChannelControl.cpp index 360a775940..566798ef11 100644 --- a/src/kits/interface/ChannelControl.cpp +++ b/src/kits/interface/ChannelControl.cpp @@ -168,12 +168,17 @@ BChannelControl::DetachedFromWindow() } +void +BChannelControl::GetPreferredSize(float *_width, float *_height) +{ + BControl::GetPreferredSize(_width, _height); +} + + void BChannelControl::ResizeToPreferred() { - float width, height; - GetPreferredSize(&width, &height); - ResizeTo(width, height); + BControl::ResizeToPreferred(); } diff --git a/src/kits/interface/ChannelSlider.cpp b/src/kits/interface/ChannelSlider.cpp index 41e8536320..4645127c6c 100644 --- a/src/kits/interface/ChannelSlider.cpp +++ b/src/kits/interface/ChannelSlider.cpp @@ -232,10 +232,12 @@ BChannelSlider::Draw(BRect updateRect) UpdateFontDimens(); DrawThumbs(); - BRect bounds(Bounds()); - float labelWidth = StringWidth(Label()); + if (Label()) { + BRect bounds(Bounds()); + float labelWidth = StringWidth(Label()); - DrawString(Label(), BPoint((bounds.Width() - labelWidth) / 2, fBaseLine)); + DrawString(Label(), BPoint((bounds.Width() - labelWidth) / 2, fBaseLine)); + } } @@ -398,7 +400,7 @@ BChannelSlider::SetEnabled(bool on) void BChannelSlider::GetPreferredSize(float *width, float *height) { - // TODO: Implement + BChannelControl::GetPreferredSize(width, height); }