Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
e6194ef5
Commit
e6194ef5
authored
Aug 14, 2012
by
Aleksei Kanash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Audio items is white now.
Media control improved. Code was cleaned.
parent
fecd1f95
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
10 deletions
+22
-10
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+10
-5
UBGraphicsItemDelegate.h
src/domain/UBGraphicsItemDelegate.h
+1
-0
UBGraphicsMediaItem.cpp
src/domain/UBGraphicsMediaItem.cpp
+11
-2
UBGraphicsMediaItemDelegate.cpp
src/domain/UBGraphicsMediaItemDelegate.cpp
+0
-3
No files found.
src/domain/UBGraphicsItemDelegate.cpp
View file @
e6194ef5
...
...
@@ -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
)))
{
...
...
src/domain/UBGraphicsItemDelegate.h
View file @
e6194ef5
...
...
@@ -149,6 +149,7 @@ class DelegateMediaControl: public QObject, public QGraphicsRectItem
private
:
int
mStartWidth
;
int
mSeecAreaBorderHeight
;
QRectF
mSeecArea
;
QRectF
mLCDTimerArea
;
...
...
src/domain/UBGraphicsMediaItem.cpp
View file @
e6194ef5
...
...
@@ -35,11 +35,20 @@ UBAudioPresentationWidget::UBAudioPresentationWidget(QWidget *parent)
void
UBAudioPresentationWidget
::
paintEvent
(
QPaintEvent
*
event
)
{
QPainter
painter
(
this
);
painter
.
fillRect
(
rect
(),
QBrush
(
Qt
::
black
));
painter
.
fillRect
(
rect
(),
QBrush
(
Qt
::
white
));
painter
.
drawRoundedRect
(
1
,
1
,
width
()
-
2
,
height
()
-
2
,
height
()
/
5
,
height
()
/
5
);
QImage
mask_img
(
size
(),
QImage
::
Format_Mono
);
mask_img
.
fill
(
0xff
);
QPainter
mask_painter
(
&
mask_img
);
mask_painter
.
setBrush
(
QBrush
(
QColor
(
0
,
0
,
0
)));
mask_painter
.
drawRoundedRect
(
1
,
1
,
width
()
-
3
,
height
()
-
3
,
height
()
/
5
,
height
()
/
5
);
setMask
(
QBitmap
::
fromImage
(
mask_img
));
if
(
QString
()
!=
mTitle
)
{
painter
.
setPen
(
QPen
(
Qt
::
white
));
painter
.
setPen
(
QPen
(
Qt
::
black
));
QRect
titleRect
=
rect
();
titleRect
.
setX
(
mBorderSize
);
titleRect
.
setY
(
2
);
...
...
src/domain/UBGraphicsMediaItemDelegate.cpp
View file @
e6194ef5
...
...
@@ -135,7 +135,6 @@ void UBGraphicsMediaItemDelegate::positionHandles()
if
(
mediaItem
->
getMediaType
()
==
UBGraphicsMediaItem
::
mediaType_Video
)
{
mToolBarItem
->
setPos
(
0
,
delegated
()
->
boundingRect
().
height
()
-
mToolBarItem
->
rect
().
height
());
// mToolBarItem->setScale(AntiScaleRatio);
toolBarRect
.
setWidth
(
delegated
()
->
boundingRect
().
width
());
}
...
...
@@ -191,8 +190,6 @@ void UBGraphicsMediaItemDelegate::remove(bool canUndo)
if
(
delegated
()
&&
delegated
()
->
mediaObject
())
delegated
()
->
mediaObject
()
->
stop
();
QGraphicsScene
*
scene
=
mDelegated
->
scene
();
UBGraphicsItemDelegate
::
remove
(
canUndo
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment