return pv::util::format_time(time_, view_.tick_prefix(), 2);
}
-QRectF Cursor::get_label_rect(const QRect &rect) const
+QRectF Cursor::label_rect(const QRectF &rect) const
{
const shared_ptr<Cursor> other(get_other_cursor());
assert(other);
* @param rect The rectangle of the ruler client area.
* @return Returns the label rectangle.
*/
- QRectF get_label_rect(const QRect &rect) const;
+ QRectF label_rect(const QRectF &rect) const;
private:
std::shared_ptr<Cursor> get_other_cursor() const;
if (view_.cursors_shown()) {
shared_ptr<CursorPair> cursors(view_.cursors());
- if (cursors->first()->get_label_rect(
+ if (cursors->first()->label_rect(
rect()).contains(e->pos()))
grabbed_marker_ = cursors->first();
- else if (cursors->second()->get_label_rect(
+ else if (cursors->second()->label_rect(
rect()).contains(e->pos()))
grabbed_marker_ = cursors->second();
}
return nullptr;
}
-QRectF CursorPair::get_label_rect(const QRect &rect) const
+QRectF CursorPair::label_rect(const QRectF &rect) const
{
const QSizeF label_size(
text_size_.width() + View::LabelPadding.width() * 2,
const unsigned int prefix = view_.tick_prefix();
compute_text_size(p, prefix);
- QRectF delta_rect(get_label_rect(rect));
+ QRectF delta_rect(label_rect(rect));
const int radius = delta_rect.height() / 2;
const QRectF text_rect(delta_rect.intersected(
pv::widgets::Popup* create_popup(QWidget *parent);
public:
- QRectF get_label_rect(const QRect &rect) const;
+ QRectF label_rect(const QRectF &rect) const;
void draw_markers(QPainter &p, const QRect &rect);
p.drawLine(QPointF(x, rect.top()), QPointF(x, rect.bottom()));
}
-QRectF TimeMarker::get_label_rect(const QRect &rect) const
+QRectF TimeMarker::label_rect(const QRectF &rect) const
{
const float x = (time_ - view_.offset()) / view_.scale();
return;
const qreal x = (time_ - view_.offset()) / view_.scale();
- const QRectF r(get_label_rect(rect));
+ const QRectF r(label_rect(rect));
const QPointF points[] = {
r.topLeft(),
* @param rect The rectangle of the ruler client area.
* @return Returns the label rectangle.
*/
- virtual QRectF get_label_rect(const QRect &rect) const;
+ virtual QRectF label_rect(const QRectF &rect) const;
/**
* Paints the marker's label to the ruler.