Merge branch 'master' of github.com:Sankore/Sankore-3.1

preferencesAboutTextFull
Claudio Valerio 12 years ago
commit 7e0ec83a0b
  1. 6
      src/adaptors/UBSvgSubsetAdaptor.cpp
  2. 7
      src/domain/UBGraphicsItemDelegate.cpp
  3. 2
      src/domain/UBGraphicsItemDelegate.h
  4. 23
      src/domain/UBGraphicsTextItemDelegate.cpp
  5. 2
      src/domain/UBGraphicsTextItemDelegate.h

@ -2769,6 +2769,12 @@ UBGraphicsTextItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::textItemFromSvg()
} }
} }
QTextCursor curCursor = textItem->textCursor();
QTextCharFormat format;
format.setFont(font);
curCursor.mergeCharFormat(format);
textItem->setTextCursor(curCursor);
textItem->setFont(font); textItem->setFont(font);
QStringRef fill = mXmlReader.attributes().value("color"); QStringRef fill = mXmlReader.attributes().value("color");

@ -115,6 +115,7 @@ UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObjec
, mToolBarUsed(useToolBar) , mToolBarUsed(useToolBar)
{ {
// NOOP // NOOP
connect(UBApplication::boardController, SIGNAL(zoomChanged(qreal)), this, SLOT(onZoomChanged()));
} }
void UBGraphicsItemDelegate::init() void UBGraphicsItemDelegate::init()
@ -535,6 +536,12 @@ void UBGraphicsItemDelegate::commitUndoStep()
} }
} }
void UBGraphicsItemDelegate::onZoomChanged()
{
mAntiScaleRatio = 1 / (UBApplication::boardController->systemScaleFactor() * UBApplication::boardController->currentZoom());
positionHandles();
}
void UBGraphicsItemDelegate::buildButtons() void UBGraphicsItemDelegate::buildButtons()
{ {

@ -259,6 +259,8 @@ class UBGraphicsItemDelegate : public QObject
void increaseZlevelTop(); void increaseZlevelTop();
void increaseZlevelBottom(); void increaseZlevelBottom();
void onZoomChanged();
protected: protected:
virtual void buildButtons(); virtual void buildButtons();
virtual void decorateMenu(QMenu *menu); virtual void decorateMenu(QMenu *menu);

@ -322,6 +322,12 @@ void UBGraphicsTextItemDelegate::positionHandles()
void UBGraphicsTextItemDelegate::ChangeTextSize(qreal factor, textChangeMode changeMode) void UBGraphicsTextItemDelegate::ChangeTextSize(qreal factor, textChangeMode changeMode)
{ {
if (scaleSize == changeMode)
{
if (1 == factor)
return;
}
else
if (0 == factor) if (0 == factor)
return; return;
@ -403,3 +409,20 @@ void UBGraphicsTextItemDelegate::scaleTextSize(qreal multiplyer)
{ {
ChangeTextSize(multiplyer, scaleSize); ChangeTextSize(multiplyer, scaleSize);
} }
QVariant UBGraphicsTextItemDelegate::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
{
if (change == QGraphicsItem::ItemSelectedChange)
{
if (delegated()->isSelected())
{
QTextCursor c = delegated()->textCursor();
if (c.hasSelection())
{
c.clearSelection();
delegated()->setTextCursor(c);
}
}
}
return UBGraphicsItemDelegate::itemChange(change, value);
}

@ -40,6 +40,8 @@ class UBGraphicsTextItemDelegate : public UBGraphicsItemDelegate
virtual ~UBGraphicsTextItemDelegate(); virtual ~UBGraphicsTextItemDelegate();
bool isEditable(); bool isEditable();
void scaleTextSize(qreal multiplyer); void scaleTextSize(qreal multiplyer);
virtual QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value);
public slots: public slots:
void contentsChanged(); void contentsChanged();

Loading…
Cancel
Save