- const int text_height = calculate_text_height();
- return QSize(0, RulerHeight * text_height +
- (text_height + Padding + BaselineOffset) / 2);
+ QRectF max_rect;
+ std::vector< std::shared_ptr<TimeItem> > items(view_.time_items());
+ for (auto &i : items)
+ max_rect = max_rect.united(i->label_rect(QRect()));
+ return QSize(0, sizeHint().height() - max_rect.top() / 2 +
+ ViewItem::HighlightRadius);