X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Ftracetreeitem.hpp;h=56e1d73cbf2831e6785e009361a8e6ad28b0e338;hp=3b216988dd7d528cbaf73c9f49b88a512731e814;hb=f4e57597347e47a4ea58fbdc7b0a22e07f1c0ede;hpb=af503b104d890a357c736c678bb00296d889c090 diff --git a/pv/view/tracetreeitem.hpp b/pv/view/tracetreeitem.hpp index 3b216988..56e1d73c 100644 --- a/pv/view/tracetreeitem.hpp +++ b/pv/view/tracetreeitem.hpp @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef PULSEVIEW_PV_VIEW_TRACETREEITEM_HPP -#define PULSEVIEW_PV_VIEW_TRACETREEITEM_HPP +#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_TRACETREEITEM_HPP +#define PULSEVIEW_PV_VIEWS_TRACEVIEW_TRACETREEITEM_HPP #include @@ -28,12 +28,13 @@ #include "rowitem.hpp" namespace pv { -namespace view { +namespace views { +namespace TraceView { class TraceTreeItemOwner; class TraceTreeItem : public RowItem, - public std::enable_shared_from_this + public std::enable_shared_from_this { Q_OBJECT Q_PROPERTY(int visual_v_offset @@ -46,6 +47,16 @@ public: */ TraceTreeItem(); + /** + * Gets the owner of this item in the view item hierachy. + */ + TraceTreeItemOwner* owner() const; + + /** + * Selects or deselects the signal. + */ + void select(bool select = true); + /** * Gets the vertical layout offset of this signal. */ @@ -77,16 +88,11 @@ public: */ void animate_to_layout_v_offset(); - /** - * Gets the owner this trace in the view trace hierachy. - */ - pv::view::TraceTreeItemOwner* owner() const; - /** * Sets the owner this trace in the view trace hierachy. * @param The new owner of the trace. */ - void set_owner(pv::view::TraceTreeItemOwner *owner); + void set_owner(TraceTreeItemOwner *owner); /** * Gets the visual y-offset of the axis. @@ -105,26 +111,34 @@ public: */ QPoint point(const QRect &rect) const; + /** + * Sets the new background colour state: false = dark, true = bright. + * This is to allow for alternating backgrounds but has no effect + * when coloured background colours are used. + * @param state New bg color state to use. + */ + void set_bgcolour_state(bool state); + /** * Computes the vertical extents of the contents of this row item. * @return A pair containing the minimum and maximum y-values. */ virtual std::pair v_extents() const = 0; -public: - virtual void hover_point_changed(); - protected: - pv::view::TraceTreeItemOwner *owner_; + TraceTreeItemOwner *owner_; int layout_v_offset_; int visual_v_offset_; + bool bgcolour_state_; + private: QPropertyAnimation v_offset_animation_; }; -} // namespace view +} // namespace TraceView +} // namespace views } // namespace pv -#endif // PULSEVIEW_PV_VIEW_TRACETREEITEM_HPP +#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_TRACETREEITEM_HPP