|
|
@ -891,25 +891,18 @@ void UBGraphicsScene::recolorAllItems() |
|
|
|
view->setViewportUpdateMode(QGraphicsView::NoViewportUpdate); |
|
|
|
view->setViewportUpdateMode(QGraphicsView::NoViewportUpdate); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < mFastAccessItems.size(); i++) |
|
|
|
bool currentIslight = isLightBackground(); |
|
|
|
{ |
|
|
|
foreach (QGraphicsItem *item, items()) { |
|
|
|
UBGraphicsPolygonItem *polygonItem = qgraphicsitem_cast<UBGraphicsPolygonItem*> (mFastAccessItems.at(i)); |
|
|
|
if (item->type() == UBGraphicsStrokesGroup::Type) { |
|
|
|
|
|
|
|
UBGraphicsStrokesGroup *curGroup = static_cast<UBGraphicsStrokesGroup*>(item); |
|
|
|
if (polygonItem) |
|
|
|
QColor compareColor = curGroup->color(currentIslight ? UBGraphicsStrokesGroup::colorOnDarkBackground |
|
|
|
{ |
|
|
|
: UBGraphicsStrokesGroup::colorOnLightBackground); |
|
|
|
QColor color; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mDarkBackground) |
|
|
|
if (curGroup->color() == compareColor) { |
|
|
|
{ |
|
|
|
QColor newColor = curGroup->color(!currentIslight ? UBGraphicsStrokesGroup::colorOnDarkBackground |
|
|
|
color = polygonItem->colorOnDarkBackground(); |
|
|
|
: UBGraphicsStrokesGroup::colorOnLightBackground); |
|
|
|
|
|
|
|
curGroup->setColor(newColor); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
color = polygonItem->colorOnLightBackground(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
polygonItem->setColor(color); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|