Make sure the duration view has a fixed width for
all display modes for a given clip. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38603 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -52,14 +52,14 @@ DurationView::MouseDown(BPoint where)
|
|||||||
BSize
|
BSize
|
||||||
DurationView::MinSize()
|
DurationView::MinSize()
|
||||||
{
|
{
|
||||||
// If we wanted to have a fixed size:
|
BSize size;
|
||||||
// BSize size;
|
char string[64];
|
||||||
// size.width = StringWidth("-00:00:00");
|
duration_to_string(int32(fDuration / -1000000LL), string, sizeof(string));
|
||||||
// font_height fontHeight;
|
size.width = StringWidth(string);
|
||||||
// GetFontHeight(&fontHeight);
|
font_height fontHeight;
|
||||||
// size.height = ceilf(fontHeight.ascent) + ceilf(fontHeight.descent);
|
GetFontHeight(&fontHeight);
|
||||||
// return BLayoutUtils::ComposeSize(ExplicitMinSize(), size);
|
size.height = ceilf(fontHeight.ascent) + ceilf(fontHeight.descent);
|
||||||
return BStringView::MinSize();
|
return BLayoutUtils::ComposeSize(ExplicitMinSize(), size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -80,7 +80,10 @@ DurationView::Update(bigtime_t position, bigtime_t duration)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
fPosition = position;
|
fPosition = position;
|
||||||
fDuration = duration;
|
if (fDuration != duration) {
|
||||||
|
fDuration = duration;
|
||||||
|
InvalidateLayout();
|
||||||
|
}
|
||||||
_Update();
|
_Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user