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

preferencesAboutTextFull
bmagnin 12 years ago
commit ef62f59341
  1. 7
      src/domain/UBGraphicsItemDelegate.cpp
  2. 2
      src/domain/UBGraphicsItemDelegate.h
  3. 13
      src/domain/UBGraphicsMediaItemDelegate.cpp

@ -418,7 +418,6 @@ bool UBGraphicsItemDelegate::isLocked()
void UBGraphicsItemDelegate::duplicate() void UBGraphicsItemDelegate::duplicate()
{ {
// TODO UB 4.x .. rewrite .. .this is absurde ... we know what we are duplicating
UBApplication::boardController->duplicateItem(dynamic_cast<UBItem*>(delegated())); UBApplication::boardController->duplicateItem(dynamic_cast<UBItem*>(delegated()));
} }
@ -1190,8 +1189,6 @@ void DelegateMediaControl::positionHandles()
mLCDTimerArea.setHeight(parentItem()->boundingRect().height()); mLCDTimerArea.setHeight(parentItem()->boundingRect().height());
lcdTimer->setRect(mLCDTimerArea); lcdTimer->setRect(mLCDTimerArea);
lcdTimer->setPos(mSeecArea.width()-mLCDTimerArea.width(),0); lcdTimer->setPos(mSeecArea.width()-mLCDTimerArea.width(),0);
//lcdTimer->setRect(mLCDTimerArea);
//lcdTimer->setPos(mSeecArea.width()-mLCDTimerArea.width(),0);
mSeecArea.setWidth(rect().width()-mLCDTimerArea.width()); mSeecArea.setWidth(rect().width()-mLCDTimerArea.width());
@ -1200,8 +1197,6 @@ void DelegateMediaControl::positionHandles()
setRect(selfRect); setRect(selfRect);
lcdTimer->setPos(rect().width() - mLCDTimerArea.width(), 0); lcdTimer->setPos(rect().width() - mLCDTimerArea.width(), 0);
//lcdTimer->setPos(rect().width() - mLCDTimerArea.width(), 0);
} }
void DelegateMediaControl::update() void DelegateMediaControl::update()
@ -1209,7 +1204,6 @@ void DelegateMediaControl::update()
QTime t; QTime t;
t = t.addMSecs(mCurrentTimeInMs < 0 ? 0 : mCurrentTimeInMs); t = t.addMSecs(mCurrentTimeInMs < 0 ? 0 : mCurrentTimeInMs);
lcdTimer->display(t.toString("m:ss")); lcdTimer->display(t.toString("m:ss"));
//lcdTimer->display(t.toString("m:ss"));
QGraphicsRectItem::update(); QGraphicsRectItem::update();
} }
@ -1262,7 +1256,6 @@ void DelegateMediaControl::seekToMousePos(QPointF mousePos)
minX = frameWidth; minX = frameWidth;
length = mSeecArea.width() - lcdTimer->rect().width(); length = mSeecArea.width() - lcdTimer->rect().width();
length = mSeecArea.width() /*- lcdTimer->rect().width()*/;
qreal mouseX = mousePos.x(); qreal mouseX = mousePos.x();
if (mouseX >= (mSeecArea.width() - mSeecArea.height()/2)) if (mouseX >= (mSeecArea.width() - mSeecArea.height()/2))

@ -284,7 +284,7 @@ class UBGraphicsItemDelegate : public QObject
qreal mAntiScaleRatio; qreal mAntiScaleRatio;
QList<DelegateButton*> mButtons; QList<DelegateButton*> mButtons;
QList<DelegateButton*> mToolBarButtons;
UBGraphicsToolBarItem* mToolBarItem; UBGraphicsToolBarItem* mToolBarItem;
protected slots: protected slots:

@ -94,7 +94,7 @@ void UBGraphicsMediaItemDelegate::buildButtons()
connect(mMuteButton, SIGNAL(clicked(bool)), delegated(), SLOT(toggleMute())); connect(mMuteButton, SIGNAL(clicked(bool)), delegated(), SLOT(toggleMute()));
connect(mMuteButton, SIGNAL(clicked(bool)), this, SLOT(toggleMute())); // for changing button image connect(mMuteButton, SIGNAL(clicked(bool)), this, SLOT(toggleMute())); // for changing button image
mButtons << mPlayPauseButton << mStopButton << mMuteButton; mToolBarButtons << mPlayPauseButton << mStopButton << mMuteButton;
mToolBarItem->setItemsOnToolBar(QList<QGraphicsItem*>() << mPlayPauseButton << mStopButton << mMediaControl << mMuteButton); mToolBarItem->setItemsOnToolBar(QList<QGraphicsItem*>() << mPlayPauseButton << mStopButton << mMediaControl << mMuteButton);
mToolBarItem->setVisibleOnBoard(true); mToolBarItem->setVisibleOnBoard(true);
@ -156,13 +156,10 @@ void UBGraphicsMediaItemDelegate::positionHandles()
int toolBarMinimumWidth = 0; int toolBarMinimumWidth = 0;
int mediaItemWidth = mToolBarItem->boundingRect().width(); int mediaItemWidth = mToolBarItem->boundingRect().width();
foreach (DelegateButton* button, mButtons) foreach (DelegateButton* button, mToolBarButtons)
{ {
if (button->getSection() == Qt::TitleBarArea) mediaItemWidth -= button->boundingRect().width() + mToolBarItem->getElementsPadding();
{ toolBarMinimumWidth += button->boundingRect().width() + mToolBarItem->getElementsPadding();
mediaItemWidth -= button->boundingRect().width() + mToolBarItem->getElementsPadding();
toolBarMinimumWidth += button->boundingRect().width() + mToolBarItem->getElementsPadding();
}
} }
toolBarMinimumWidth += mToolBarItem->boundingRect().height(); toolBarMinimumWidth += mToolBarItem->boundingRect().height();
@ -196,8 +193,6 @@ void UBGraphicsMediaItemDelegate::remove(bool canUndo)
QGraphicsScene* scene = mDelegated->scene(); QGraphicsScene* scene = mDelegated->scene();
scene->removeItem(mMediaControl);
UBGraphicsItemDelegate::remove(canUndo); UBGraphicsItemDelegate::remove(canUndo);
} }

Loading…
Cancel
Save