recolor function of UBGraphicsTextItem should use scene's isDarkBackground instead of settings

preferencesAboutTextFull
Clément Fauconnier 5 years ago
parent e0b1417e0f
commit 87892b6e61
  1. 3
      src/domain/UBGraphicsTextItem.cpp
  2. 2
      src/domain/UBGraphicsTextItemDelegate.cpp

@ -246,9 +246,6 @@ void UBGraphicsTextItem::keyReleaseEvent(QKeyEvent *event)
void UBGraphicsTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) void UBGraphicsTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{ {
QColor color = UBSettings::settings()->isDarkBackground() ? mColorOnDarkBackground : mColorOnLightBackground;
setDefaultTextColor(color);
// Never draw the rubber band, we draw our custom selection with the DelegateFrame // Never draw the rubber band, we draw our custom selection with the DelegateFrame
QStyleOptionGraphicsItem styleOption = QStyleOptionGraphicsItem(*option); QStyleOptionGraphicsItem styleOption = QStyleOptionGraphicsItem(*option);
styleOption.state &= ~QStyle::State_Selected; styleOption.state &= ~QStyle::State_Selected;

@ -743,7 +743,7 @@ void UBGraphicsTextItemDelegate::recolor()
//setting new parameters //setting new parameters
if (UBSettings::settings()->isDarkBackground()) if (delegated()->scene()->isDarkBackground())
{ {
if (curBrush.color() == Qt::black) if (curBrush.color() == Qt::black)
{ {

Loading…
Cancel
Save