]> sigrok.org Git - pulseview.git/blobdiff - pv/view/selectableitem.hpp
SelectableItem: Moved in enabled(), and added to TriggerMarkers
[pulseview.git] / pv / view / selectableitem.hpp
index 36ff0dbcd48a95adf8626aefe751185adb1c39f7..29a5c9557973b852504e4a1ff7d7ca7bdcdad80e 100644 (file)
@@ -48,6 +48,11 @@ public:
        SelectableItem();
 
 public:
+       /**
+        * Returns true if the item is visible and enabled.
+        */
+       virtual bool enabled() const = 0;
+
        /**
         * Returns true if the item has been selected by the user.
         */
@@ -83,6 +88,15 @@ public:
         */
        virtual QPoint point() const = 0;
 
+public:
+       /**
+        * Gets the text colour.
+        * @remarks This colour is computed by comparing the lightness
+        * of the trace colour against a threshold to determine whether
+        * white or black would be more visible.
+        */
+       static QColor select_text_colour(QColor background);
+
 public:
        virtual QMenu* create_context_menu(QWidget *parent);