Clean-up of UBGraphicsScene's preview circle functions

preferencesAboutTextFull
Craig Watson 9 years ago
parent bff9b39a71
commit d5746d2e8d
  1. 16
      src/domain/UBGraphicsScene.cpp
  2. 4
      src/domain/UBGraphicsScene.h

@ -950,8 +950,8 @@ void UBGraphicsScene::setBackground(bool pIsDark, bool pIsCrossed)
{ {
mDarkBackground = pIsDark; mDarkBackground = pIsDark;
updateEraserColor(mDarkBackground); updateEraserColor();
updateMarkerCircleColor(mDarkBackground); updateMarkerCircleColor();
recolorAllItems(); recolorAllItems();
needRepaint = true; needRepaint = true;
@ -2525,7 +2525,7 @@ void UBGraphicsScene::createEraiser()
mEraser->setRect(QRect(0, 0, 0, 0)); mEraser->setRect(QRect(0, 0, 0, 0));
mEraser->setVisible(false); mEraser->setVisible(false);
updateEraserColor(mDarkBackground); updateEraserColor();
mEraser->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Control)); mEraser->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Control));
mEraser->setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::Eraiser)); //Necessary to set if we want z value to be assigned correctly mEraser->setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::Eraiser)); //Necessary to set if we want z value to be assigned correctly
@ -2560,7 +2560,7 @@ void UBGraphicsScene::createMarkerCircle()
mMarkerCircle->setVisible(false); mMarkerCircle->setVisible(false);
mMarkerCircle->setPen(Qt::DotLine); mMarkerCircle->setPen(Qt::DotLine);
updateMarkerCircleColor(mDarkBackground); updateMarkerCircleColor();
mMarkerCircle->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Control)); mMarkerCircle->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Control));
mMarkerCircle->setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::Eraiser)); mMarkerCircle->setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::Eraiser));
@ -2570,12 +2570,12 @@ void UBGraphicsScene::createMarkerCircle()
} }
} }
void UBGraphicsScene::updateEraserColor(bool darkBackground) void UBGraphicsScene::updateEraserColor()
{ {
if (!mEraser) if (!mEraser)
return; return;
if (darkBackground) { if (mDarkBackground) {
mEraser->setBrush(UBSettings::eraserBrushDarkBackground); mEraser->setBrush(UBSettings::eraserBrushDarkBackground);
mEraser->setPen(UBSettings::eraserPenDarkBackground); mEraser->setPen(UBSettings::eraserPenDarkBackground);
} }
@ -2586,7 +2586,7 @@ void UBGraphicsScene::updateEraserColor(bool darkBackground)
} }
} }
void UBGraphicsScene::updateMarkerCircleColor(bool darkBackground) void UBGraphicsScene::updateMarkerCircleColor()
{ {
if (!mMarkerCircle) if (!mMarkerCircle)
return; return;
@ -2594,7 +2594,7 @@ void UBGraphicsScene::updateMarkerCircleColor(bool darkBackground)
QBrush mcBrush = mMarkerCircle->brush(); QBrush mcBrush = mMarkerCircle->brush();
QPen mcPen = mMarkerCircle->pen(); QPen mcPen = mMarkerCircle->pen();
if (darkBackground) { if (mDarkBackground) {
mcBrush.setColor(UBSettings::markerCircleBrushColorDarkBackground); mcBrush.setColor(UBSettings::markerCircleBrushColorDarkBackground);
mcPen.setColor(UBSettings::markerCirclePenColorDarkBackground); mcPen.setColor(UBSettings::markerCirclePenColorDarkBackground);
} }

@ -385,8 +385,8 @@ public slots:
void createEraiser(); void createEraiser();
void createPointer(); void createPointer();
void createMarkerCircle(); void createMarkerCircle();
void updateEraserColor(bool darkBackground); void updateEraserColor();
void updateMarkerCircleColor(bool darkBackground); void updateMarkerCircleColor();
bool hasTextItemWithFocus(UBGraphicsGroupContainerItem* item); bool hasTextItemWithFocus(UBGraphicsGroupContainerItem* item);
QGraphicsEllipseItem* mEraser; QGraphicsEllipseItem* mEraser;

Loading…
Cancel
Save