fixes ChannelSlider::Draw when Label() is NULL
fixes a bit preferred size, still needs work git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16212 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -168,12 +168,17 @@ BChannelControl::DetachedFromWindow()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
BChannelControl::GetPreferredSize(float *_width, float *_height)
|
||||||
|
{
|
||||||
|
BControl::GetPreferredSize(_width, _height);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BChannelControl::ResizeToPreferred()
|
BChannelControl::ResizeToPreferred()
|
||||||
{
|
{
|
||||||
float width, height;
|
BControl::ResizeToPreferred();
|
||||||
GetPreferredSize(&width, &height);
|
|
||||||
ResizeTo(width, height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -232,10 +232,12 @@ BChannelSlider::Draw(BRect updateRect)
|
|||||||
UpdateFontDimens();
|
UpdateFontDimens();
|
||||||
DrawThumbs();
|
DrawThumbs();
|
||||||
|
|
||||||
BRect bounds(Bounds());
|
if (Label()) {
|
||||||
float labelWidth = StringWidth(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
|
void
|
||||||
BChannelSlider::GetPreferredSize(float *width, float *height)
|
BChannelSlider::GetPreferredSize(float *width, float *height)
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
BChannelControl::GetPreferredSize(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user