diff --git a/ground/gcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.cpp b/ground/gcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.cpp index aa13b6ea9..c91db8559 100644 --- a/ground/gcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.cpp +++ b/ground/gcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.cpp @@ -141,6 +141,16 @@ void UAVObjectTreeModel::setOnlyHighlightChangedValues(bool highlight) m_settings.setValue("onlyHighlightChangedValues", highlight); } +bool UAVObjectTreeModel::highlightTopTreeItems() const +{ + return m_settings.value("highlightTopTreeItems", false).toBool(); +} + +void UAVObjectTreeModel::setHighlightTopTreeItems(bool highlight) +{ + m_settings.setValue("highlightTopTreeItems", highlight); +} + void UAVObjectTreeModel::setupModelData() { QList rootData; @@ -571,7 +581,11 @@ QVariant UAVObjectTreeModel::data(const QModelIndex &index, int role) const case Qt::BackgroundRole: if (index.column() == TreeItem::TITLE_COLUMN) { - if (!dynamic_cast(item) && item->isHighlighted()) { + // TODO filtering here on highlightTopTreeItems() should not be necessary + // top tree items should not be highlighted at all in the first place + // when highlightTopTreeItems() is false + bool highlight = (highlightTopTreeItems() || !dynamic_cast(item)); + if (highlight && item->isHighlighted()) { return recentlyUpdatedColor(); } } else if (index.column() == TreeItem::DATA_COLUMN) { diff --git a/ground/gcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.h b/ground/gcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.h index 87b2f16cf..80f2abc62 100644 --- a/ground/gcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.h +++ b/ground/gcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.h @@ -88,6 +88,9 @@ public: bool onlyHighlightChangedValues() const; void setOnlyHighlightChangedValues(bool highlight); + bool highlightTopTreeItems() const; + void setHighlightTopTreeItems(bool highlight); + private slots: void newObject(UAVObject *obj); void updateObject(UAVObject *obj);