|
|
|
@ -1130,6 +1130,7 @@ DelegateMediaControl::DelegateMediaControl(UBGraphicsMediaItem* pDelegated, QGra |
|
|
|
|
, mCurrentTimeInMs(0) |
|
|
|
|
, mTotalTimeInMs(0) |
|
|
|
|
, mStartWidth(200) |
|
|
|
|
, mSeecAreaBorderHeight(0) |
|
|
|
|
{ |
|
|
|
|
setAcceptedMouseButtons(Qt::LeftButton); |
|
|
|
|
setBrush(QBrush(Qt::white)); |
|
|
|
@ -1153,13 +1154,14 @@ void DelegateMediaControl::paint(QPainter *painter, |
|
|
|
|
mLCDTimerArea.setHeight(rect().height()); |
|
|
|
|
mLCDTimerArea.setWidth(rect().height()); |
|
|
|
|
|
|
|
|
|
mSeecArea = rect(); |
|
|
|
|
mSeecArea.setWidth(rect().width()-mLCDTimerArea.width()-2); |
|
|
|
|
mSeecArea.setHeight(rect().height()-2*mSeecAreaBorderHeight); |
|
|
|
|
mSeecArea.setY(mSeecAreaBorderHeight); |
|
|
|
|
|
|
|
|
|
path.addRoundedRect(mSeecArea, mSeecArea.height()/2, mSeecArea.height()/2); |
|
|
|
|
painter->fillPath(path, brush()); |
|
|
|
|
|
|
|
|
|
qreal frameWidth = rect().height() / 2; |
|
|
|
|
qreal frameWidth = mSeecArea.height() / 2; |
|
|
|
|
int position = frameWidth; |
|
|
|
|
|
|
|
|
|
if (mTotalTimeInMs > 0) |
|
|
|
@ -1169,7 +1171,7 @@ void DelegateMediaControl::paint(QPainter *painter, |
|
|
|
|
|
|
|
|
|
int clearance = 2; |
|
|
|
|
int radius = frameWidth-clearance; |
|
|
|
|
QRectF r(position - radius, clearance, radius * 2, radius * 2); |
|
|
|
|
QRectF r(position - radius, clearance+mSeecAreaBorderHeight, radius * 2, radius * 2); |
|
|
|
|
|
|
|
|
|
painter->setBrush(UBSettings::documentViewLightColor); |
|
|
|
|
painter->drawEllipse(r); |
|
|
|
@ -1190,7 +1192,10 @@ void DelegateMediaControl::positionHandles() |
|
|
|
|
lcdTimer->setRect(mLCDTimerArea); |
|
|
|
|
lcdTimer->setPos(mSeecArea.width()-mLCDTimerArea.width(),0); |
|
|
|
|
|
|
|
|
|
mSeecArea.setWidth(rect().width()-mLCDTimerArea.width()); |
|
|
|
|
mSeecAreaBorderHeight = rect().height()/20; |
|
|
|
|
mSeecArea.setWidth(rect().width()-mLCDTimerArea.width()-2); |
|
|
|
|
mSeecArea.setHeight(rect().height()-2*mSeecAreaBorderHeight); |
|
|
|
|
mSeecArea.setY(mSeecAreaBorderHeight); |
|
|
|
|
|
|
|
|
|
QRectF selfRect = rect(); |
|
|
|
|
selfRect.setHeight(parentItem()->boundingRect().height()); |
|
|
|
@ -1238,7 +1243,7 @@ void DelegateMediaControl::mousePressEvent(QGraphicsSceneMouseEvent *event) |
|
|
|
|
|
|
|
|
|
void DelegateMediaControl::mouseMoveEvent(QGraphicsSceneMouseEvent *event) |
|
|
|
|
{ |
|
|
|
|
qreal frameWidth = rect().height() / 2; |
|
|
|
|
qreal frameWidth = mSeecArea.height() / 2; |
|
|
|
|
if (boundingRect().contains(event->pos() - QPointF(frameWidth,0))
|
|
|
|
|
&& boundingRect().contains(event->pos() + QPointF(frameWidth,0))) |
|
|
|
|
{
|
|
|
|
|