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

preferencesAboutTextFull
Claudio Valerio 12 years ago
commit ce160bf39c
  1. 2
      src/adaptors/UBImportPDF.cpp
  2. 2
      src/domain/UBGraphicsMediaItem.h
  3. 25
      src/domain/UBGraphicsMediaItemDelegate.cpp
  4. 3
      src/domain/UBGraphicsMediaItemDelegate.h

@ -80,7 +80,7 @@ bool UBImportPDF::addFileToDocument(UBDocumentProxy* pDocument, const QFile& pFi
for(int pdfPageNumber = 1; pdfPageNumber <= pdfPageCount; pdfPageNumber++)
{
int pageIndex = documentPageCount + (pdfPageNumber - 1);
int pageIndex = documentPageCount + pdfPageNumber;
UBApplication::showMessage(tr("Importing page %1 of %2").arg(pdfPageNumber).arg(pdfPageCount), true);
UBGraphicsScene* scene = 0;

@ -32,7 +32,7 @@ public:
class UBAudioPresentationWidget : public QWidget
{
public:
UBAudioPresentationWidget::UBAudioPresentationWidget(QWidget *parent = NULL)
UBAudioPresentationWidget(QWidget *parent = NULL)
:QWidget(parent)
, mBorderSize(10)
, mTitleSize(10)

@ -36,7 +36,6 @@ UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pD
, mMedia(pMedia)
, mToolBarShowTimer(NULL)
, m_iToolBarShowingInterval(5000)
, mToolBarIsShown(false)
{
QPalette palette;
palette.setBrush ( QPalette::Light, Qt::darkGray );
@ -53,18 +52,12 @@ UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pD
connect(mToolBarShowTimer, SIGNAL(timeout()), this, SLOT(hideToolBar()));
mToolBarShowTimer->setInterval(m_iToolBarShowingInterval);
}
if (delegated()->getMediaType() == UBGraphicsMediaItem::mediaType_Video)
{
connect(UBApplication::boardController, SIGNAL(zoomChanged(qreal)), this, SLOT(onZoomChanged()));
}
}
bool UBGraphicsMediaItemDelegate::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(event);
mToolBarItem->show();
mToolBarIsShown = true;
if (mToolBarShowTimer)
mToolBarShowTimer->start();
@ -75,14 +68,6 @@ bool UBGraphicsMediaItemDelegate::mousePressEvent(QGraphicsSceneMouseEvent *even
void UBGraphicsMediaItemDelegate::hideToolBar()
{
mToolBarItem->hide();
mToolBarIsShown = false;
}
void UBGraphicsMediaItemDelegate::onZoomChanged()
{
positionHandles();
if (!mToolBarIsShown)
hideToolBar();
}
void UBGraphicsMediaItemDelegate::buildButtons()
@ -136,18 +121,16 @@ void UBGraphicsMediaItemDelegate::positionHandles()
{
UBGraphicsItemDelegate::positionHandles();
qreal AntiScaleRatio = 1 / (UBApplication::boardController->systemScaleFactor() * UBApplication::boardController->currentZoom());
UBGraphicsMediaItem *mediaItem = dynamic_cast<UBGraphicsMediaItem*>(mDelegated);
if (mediaItem)
{
QRectF toolBarRect = mToolBarItem->rect();
if (mediaItem->getMediaType() == UBGraphicsMediaItem::mediaType_Video)
{
mToolBarItem->setPos(0, delegated()->boundingRect().height()-mToolBarItem->rect().height());//*AntiScaleRatio);
mToolBarItem->setPos(0, delegated()->boundingRect().height()-mToolBarItem->rect().height());
// mToolBarItem->setScale(AntiScaleRatio);
toolBarRect.setWidth(delegated()->boundingRect().width());//AntiScaleRatio);
toolBarRect.setWidth(delegated()->boundingRect().width());
}
else if (mediaItem->getMediaType() == UBGraphicsMediaItem::mediaType_Audio)
{
@ -156,8 +139,8 @@ void UBGraphicsMediaItemDelegate::positionHandles()
if (audioWidget)
borderSize = audioWidget->borderSize();
mToolBarItem->setPos(borderSize,delegated()->boundingRect().height()-(mToolBarItem->rect().height() + borderSize));//*AntiScaleRatio);
toolBarRect.setWidth((delegated()->boundingRect().width()-2*borderSize));///AntiScaleRatio);
mToolBarItem->setPos(borderSize,delegated()->boundingRect().height()-(mToolBarItem->rect().height() + borderSize));
toolBarRect.setWidth((delegated()->boundingRect().width()-2*borderSize));
mToolBarItem->show();
}

@ -57,8 +57,6 @@ class UBGraphicsMediaItemDelegate : public UBGraphicsItemDelegate
void hideToolBar();
void onZoomChanged();
protected:
virtual void buildButtons();
@ -73,7 +71,6 @@ class UBGraphicsMediaItemDelegate : public UBGraphicsItemDelegate
QTimer *mToolBarShowTimer;
int m_iToolBarShowingInterval;
bool mToolBarIsShown;
};
#endif /* UBGRAPHICSMEDIAITEMDELEGATE_H_ */
Loading…
Cancel
Save