X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fview%2Ftrace.h;h=72f8e8a8986a092d82870c666e64d8a361c8bb3a;hb=3248fcde2deac2fc3fcddf0f3a5bb4695986eeb9;hp=631c8d9cb6a7435343ef806d2ed1eb6566cb7e02;hpb=9b6378f147671e62f57887d51d01864d20e01475;p=pulseview.git diff --git a/pv/view/trace.h b/pv/view/trace.h index 631c8d9c..72f8e8a8 100644 --- a/pv/view/trace.h +++ b/pv/view/trace.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef PULSEVIEW_PV_TRACE_H -#define PULSEVIEW_PV_TRACE_H +#ifndef PULSEVIEW_PV_VIEW_TRACE_H +#define PULSEVIEW_PV_VIEW_TRACE_H #include #include @@ -31,6 +31,8 @@ #include "selectableitem.h" +class QFormLayout; + namespace pv { class SigSession; @@ -133,12 +135,14 @@ public: virtual QMenu* create_context_menu(QWidget *parent); -protected: + pv::widgets::Popup* create_popup(QWidget *parent); + /** * Gets the y-offset of the axis. */ int get_y() const; +protected: /** * Gets the text colour. * @remarks This colour is computed by comparing the lightness @@ -156,6 +160,12 @@ protected: */ void paint_axis(QPainter &p, int y, int left, int right); + void add_colour_option(QWidget *parent, QFormLayout *form); + + void create_popup_form(); + + virtual void populate_popup_form(QWidget *parent, QFormLayout *form); + private: /** @@ -173,12 +183,16 @@ private: QRectF get_label_rect(int right); private slots: - void on_action_set_name_triggered(); + void on_text_changed(const QString &text); + + void on_colour_changed(const QColor &colour); - void on_action_set_colour_triggered(); + void on_popup_closed(); signals: + void visibility_changed(); void text_changed(); + void colour_changed(); protected: pv::SigSession &_session; @@ -189,9 +203,13 @@ protected: int _v_offset; QSizeF _text_size; + +private: + pv::widgets::Popup *_popup; + QFormLayout *_popup_form; }; } // namespace view } // namespace pv -#endif // PULSEVIEW_PV_TRACEL_H +#endif // PULSEVIEW_PV_VIEW_TRACE_H