mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
LP-567 add new highlightTopTreeItems property
false by default and not accessible through the UI...
This commit is contained in:
parent
7996675708
commit
64dfc358f8
@ -141,6 +141,16 @@ void UAVObjectTreeModel::setOnlyHighlightChangedValues(bool highlight)
|
|||||||
m_settings.setValue("onlyHighlightChangedValues", 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()
|
void UAVObjectTreeModel::setupModelData()
|
||||||
{
|
{
|
||||||
QList<QVariant> rootData;
|
QList<QVariant> rootData;
|
||||||
@ -571,7 +581,11 @@ QVariant UAVObjectTreeModel::data(const QModelIndex &index, int role) const
|
|||||||
|
|
||||||
case Qt::BackgroundRole:
|
case Qt::BackgroundRole:
|
||||||
if (index.column() == TreeItem::TITLE_COLUMN) {
|
if (index.column() == TreeItem::TITLE_COLUMN) {
|
||||||
if (!dynamic_cast<TopTreeItem *>(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<TopTreeItem *>(item));
|
||||||
|
if (highlight && item->isHighlighted()) {
|
||||||
return recentlyUpdatedColor();
|
return recentlyUpdatedColor();
|
||||||
}
|
}
|
||||||
} else if (index.column() == TreeItem::DATA_COLUMN) {
|
} else if (index.column() == TreeItem::DATA_COLUMN) {
|
||||||
|
@ -88,6 +88,9 @@ public:
|
|||||||
bool onlyHighlightChangedValues() const;
|
bool onlyHighlightChangedValues() const;
|
||||||
void setOnlyHighlightChangedValues(bool highlight);
|
void setOnlyHighlightChangedValues(bool highlight);
|
||||||
|
|
||||||
|
bool highlightTopTreeItems() const;
|
||||||
|
void setHighlightTopTreeItems(bool highlight);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void newObject(UAVObject *obj);
|
void newObject(UAVObject *obj);
|
||||||
void updateObject(UAVObject *obj);
|
void updateObject(UAVObject *obj);
|
||||||
|
Loading…
Reference in New Issue
Block a user