X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fruler.h;h=129b70cbe54520d0ccebb2b829a91f3b7211e496;hp=7eccc8cdda9d2222fc2c300fa0d971c9a3373d14;hb=ca4ec3eab886e62c0f9d0cc91636383a74ad5d7b;hpb=ccdd3ef548ce34f25c6c168598556a350831aa37 diff --git a/pv/view/ruler.h b/pv/view/ruler.h index 7eccc8cd..129b70cb 100644 --- a/pv/view/ruler.h +++ b/pv/view/ruler.h @@ -1,5 +1,5 @@ /* - * This file is part of the sigrok project. + * This file is part of the PulseView project. * * Copyright (C) 2012 Joel Holdsworth * @@ -18,14 +18,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef PV_VIEW_RULER_H -#define PV_VIEW_RULER_H +#ifndef PULSEVIEW_PV_VIEW_RULER_H +#define PULSEVIEW_PV_VIEW_RULER_H #include namespace pv { namespace view { +class TimeMarker; class View; class Ruler : public QWidget @@ -39,17 +40,36 @@ private: static const QString SIPrefixes[9]; static const int FirstSIPrefixPower; + static const int HoverArrowSize; + public: Ruler(View &parent); private: void paintEvent(QPaintEvent *event); + void mouseMoveEvent(QMouseEvent *e); + void mousePressEvent(QMouseEvent *e); + void mouseReleaseEvent(QMouseEvent *); + +private: + void draw_cursors(QPainter &p); + + /** + * Draw a hover arrow under the cursor position. + */ + void draw_hover_mark(QPainter &p); + +private slots: + void hover_point_changed(); + private: View &_view; + + TimeMarker *_grabbed_marker; }; } // namespace view } // namespace pv -#endif // PV_VIEW_HEADER_H +#endif // PULSEVIEW_PV_VIEW_RULER_H