diff --git a/src/libs/libiveditor/itemeditor/ivflowconnectiongraphicsitem.cpp b/src/libs/libiveditor/itemeditor/ivflowconnectiongraphicsitem.cpp index dd24ba940db33fd2b46400de10c89eb0e3df28cd..6f9f59c50e10ddbfe1c97ee8e276054cedc20009 100644 --- a/src/libs/libiveditor/itemeditor/ivflowconnectiongraphicsitem.cpp +++ b/src/libs/libiveditor/itemeditor/ivflowconnectiongraphicsitem.cpp @@ -30,10 +30,4 @@ shared::ColorManager::HandledColors IVFlowConnectionGraphicsItem::handledColorTy return shared::ColorManager::HandledColors::ConnectionFlow; } -void IVFlowConnectionGraphicsItem::applyColorScheme() -{ - shared::ColorHandler ch = colorHandler(); - m_item->setPen(ch.pen()); - update(); -} } diff --git a/src/libs/libiveditor/itemeditor/ivflowconnectiongraphicsitem.h b/src/libs/libiveditor/itemeditor/ivflowconnectiongraphicsitem.h index 4f861e09b02a272af27e1e0e9486ebc748365c5d..92bb1c213c61f263da9d3d1f31db70dd2a32e443 100644 --- a/src/libs/libiveditor/itemeditor/ivflowconnectiongraphicsitem.h +++ b/src/libs/libiveditor/itemeditor/ivflowconnectiongraphicsitem.h @@ -32,9 +32,6 @@ public: protected: shared::ColorManager::HandledColors handledColorType() const override; - -protected Q_SLOTS: - void applyColorScheme() override; }; } diff --git a/src/libs/libiveditor/itemeditor/ivfunctiongraphicsitem.cpp b/src/libs/libiveditor/itemeditor/ivfunctiongraphicsitem.cpp index 94eaf1fb783071ce34c8e93195387e29e9f0ba3d..8a5f31d9a1fa60cefdac1a3561cba8d1fc31147b 100644 --- a/src/libs/libiveditor/itemeditor/ivfunctiongraphicsitem.cpp +++ b/src/libs/libiveditor/itemeditor/ivfunctiongraphicsitem.cpp @@ -130,7 +130,8 @@ shared::ColorManager::HandledColors IVFunctionGraphicsItem::handledColorType() c && !sceneBoundingRect().contains(nestedRect.marginsAdded(shared::graphicsviewutils::kContentMargins))) return shared::ColorManager::HandledColors::FunctionPartial; - return shared::ColorManager::HandledColors::FunctionRegular; + return entity()->isMarked() ? shared::ColorManager::HandledColors::FunctionHighlighted + : shared::ColorManager::HandledColors::FunctionRegular; } shared::ui::TextItem *IVFunctionGraphicsItem::initTextItem() diff --git a/src/libs/libiveditor/itemeditor/ivfunctiontypegraphicsitem.cpp b/src/libs/libiveditor/itemeditor/ivfunctiontypegraphicsitem.cpp index 6d3d959163e4008d0ccc2012b378d9acc8f8e6a7..a670137416bd01f37f3b5e426bdba6d6ca85ee87 100644 --- a/src/libs/libiveditor/itemeditor/ivfunctiontypegraphicsitem.cpp +++ b/src/libs/libiveditor/itemeditor/ivfunctiontypegraphicsitem.cpp @@ -154,7 +154,6 @@ void IVFunctionTypeGraphicsItem::updateTextPosition() shared::ColorManager::HandledColors IVFunctionTypeGraphicsItem::handledColorType() const { - return entity()->isMarked() ? shared::ColorManager::HandledColors::FunctionTypeHighlighted : shared::ColorManager::HandledColors::FunctionType; } diff --git a/src/libs/shared/ui/veconnectiongraphicsitem.cpp b/src/libs/shared/ui/veconnectiongraphicsitem.cpp index 98fa6d9ddac2597b3fd52fdb3437b0cc724f10c8..85220871aed1652bfce23015a75df402619f33a1 100644 --- a/src/libs/shared/ui/veconnectiongraphicsitem.cpp +++ b/src/libs/shared/ui/veconnectiongraphicsitem.cpp @@ -556,6 +556,14 @@ void VEConnectionGraphicsItem::onSelectionChanged(bool isSelected) shared::ui::VEInteractiveObject::onSelectionChanged(isSelected); } +void VEConnectionGraphicsItem::applyColorScheme() +{ + VEInteractiveObject::applyColorScheme(); + if (!isSelected()) { + m_item->setPen(pen()); + } +} + bool VEConnectionGraphicsItem::removeCollidedGrips(GripPoint *gp) { auto grips = gripPointsHandler()->gripPoints(); diff --git a/src/libs/shared/ui/veconnectiongraphicsitem.h b/src/libs/shared/ui/veconnectiongraphicsitem.h index 42af28744efd9a343633180f1fda298f81f9ecc2..f42e1a509a7c4cb3c64e40b5601b9ebffa84b096 100644 --- a/src/libs/shared/ui/veconnectiongraphicsitem.h +++ b/src/libs/shared/ui/veconnectiongraphicsitem.h @@ -93,6 +93,7 @@ protected: protected Q_SLOTS: void rebuildLayout() override; void onSelectionChanged(bool isSelected) override; + void applyColorScheme() override; private: bool removeCollidedGrips(GripPoint *gp); diff --git a/src/libs/shared/ui/veinteractiveobject.cpp b/src/libs/shared/ui/veinteractiveobject.cpp index ad2370bf314b84a320cd2945111502e36baf597f..e7a7856072e0d82a4451cc227e1cbb845372a9f6 100644 --- a/src/libs/shared/ui/veinteractiveobject.cpp +++ b/src/libs/shared/ui/veinteractiveobject.cpp @@ -94,7 +94,8 @@ shared::ColorHandler VEInteractiveObject::colorHandler() const using namespace StyleAttribute; shared::ColorHandler h = InteractiveObjectBase::colorHandler(); // Read color from entity (the model) and set it on the colorhandler - if (auto ivObj = entity()) { + shared::VEObject *ivObj = entity(); + if (!ivObj->isMarked()) { if (ivObj->hasEntityAttribute(QLatin1String("color"))) { h.detach(); } else { diff --git a/src/libs/shared/ui/veinteractiveobject.h b/src/libs/shared/ui/veinteractiveobject.h index 300d5c784d6651ecadfa84c54930cd9eb0ec4815..c0e89691bd549aab33773bef9b64f794be12a31c 100644 --- a/src/libs/shared/ui/veinteractiveobject.h +++ b/src/libs/shared/ui/veinteractiveobject.h @@ -38,15 +38,6 @@ class VEInteractiveObject : public InteractiveObjectBase public: explicit VEInteractiveObject(VEObject *entity, QGraphicsItem *parent = nullptr); - QPen pen() const; - void setPen(const QPen &pen); - - QBrush brush() const; - void setBrush(const QBrush &brush); - - QFont font() const; - void setFont(const QFont &font); - void setCommandsStack(cmd::CommandsStackBase *commandsStack); QString toString() const; @@ -101,7 +92,14 @@ public Q_SLOTS: virtual void applyColorScheme(); protected: - // Methods to be implemented by child classes + QPen pen() const; + void setPen(const QPen &pen); + + QBrush brush() const; + void setBrush(const QBrush &brush); + + QFont font() const; + void setFont(const QFont &font); /** * @brief initTextItem sets up a basic (non-interactive) text item.