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