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
830a7f20
Commit
830a7f20
authored
Jul 18, 2013
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvements of the control media bar
parent
f619a0f2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
38 deletions
+32
-38
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+1
-10
UBGraphicsMediaItemDelegate.cpp
src/domain/UBGraphicsMediaItemDelegate.cpp
+31
-28
No files found.
src/domain/UBGraphicsItemDelegate.cpp
View file @
830a7f20
...
@@ -1120,8 +1120,7 @@ void MediaTimer::addPoint(QPolygon &a, const QPoint &p)
...
@@ -1120,8 +1120,7 @@ void MediaTimer::addPoint(QPolygon &a, const QPoint &p)
a
.
setPoint
(
n
,
p
);
a
.
setPoint
(
n
,
p
);
}
}
void
MediaTimer
::
paint
(
QPainter
*
p
,
void
MediaTimer
::
paint
(
QPainter
*
p
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
)
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
)
{
{
Q_UNUSED
(
option
);
Q_UNUSED
(
option
);
Q_UNUSED
(
widget
);
Q_UNUSED
(
widget
);
...
@@ -1300,10 +1299,6 @@ QPainterPath DelegateMediaControl::shape() const
...
@@ -1300,10 +1299,6 @@ QPainterPath DelegateMediaControl::shape() const
void
DelegateMediaControl
::
positionHandles
()
void
DelegateMediaControl
::
positionHandles
()
{
{
QRectF
selfRect
=
rect
();
selfRect
.
setHeight
(
parentItem
()
->
boundingRect
().
height
());
setRect
(
selfRect
);
QTime
tTotal
;
QTime
tTotal
;
tTotal
=
tTotal
.
addMSecs
(
mTotalTimeInMs
);
tTotal
=
tTotal
.
addMSecs
(
mTotalTimeInMs
);
mLCDTimerArea
.
setHeight
(
parentItem
()
->
boundingRect
().
height
());
mLCDTimerArea
.
setHeight
(
parentItem
()
->
boundingRect
().
height
());
...
@@ -1329,10 +1324,6 @@ void DelegateMediaControl::positionHandles()
...
@@ -1329,10 +1324,6 @@ void DelegateMediaControl::positionHandles()
mLCDTimerArea
.
setWidth
(
timerWidth
);
mLCDTimerArea
.
setWidth
(
timerWidth
);
lcdTimer
->
setRect
(
mLCDTimerArea
);
lcdTimer
->
setRect
(
mLCDTimerArea
);
// not the best solution, but it works.
lcdTimer
->
positionHandles
();
mLCDTimerArea
=
lcdTimer
->
rect
();
// -------------------------------------
lcdTimer
->
setPos
(
rect
().
width
()
-
mLCDTimerArea
.
width
(),
0
);
lcdTimer
->
setPos
(
rect
().
width
()
-
mLCDTimerArea
.
width
(),
0
);
...
...
src/domain/UBGraphicsMediaItemDelegate.cpp
View file @
830a7f20
...
@@ -44,6 +44,7 @@ UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pD
...
@@ -44,6 +44,7 @@ UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pD
|
GF_RESPECT_RATIO
|
GF_RESPECT_RATIO
|
GF_TOOLBAR_USED
|
GF_TOOLBAR_USED
|
GF_SHOW_CONTENT_SOURCE
)
|
GF_SHOW_CONTENT_SOURCE
)
,
mPlayPauseButton
(
NULL
)
,
mMedia
(
pMedia
)
,
mMedia
(
pMedia
)
,
mToolBarShowTimer
(
NULL
)
,
mToolBarShowTimer
(
NULL
)
,
m_iToolBarShowingInterval
(
5000
)
,
m_iToolBarShowingInterval
(
5000
)
...
@@ -88,6 +89,7 @@ void UBGraphicsMediaItemDelegate::hideToolBar()
...
@@ -88,6 +89,7 @@ void UBGraphicsMediaItemDelegate::hideToolBar()
void
UBGraphicsMediaItemDelegate
::
buildButtons
()
void
UBGraphicsMediaItemDelegate
::
buildButtons
()
{
{
if
(
!
mPlayPauseButton
){
mPlayPauseButton
=
new
DelegateButton
(
":/images/play.svg"
,
mDelegated
,
mToolBarItem
,
Qt
::
TitleBarArea
);
mPlayPauseButton
=
new
DelegateButton
(
":/images/play.svg"
,
mDelegated
,
mToolBarItem
,
Qt
::
TitleBarArea
);
connect
(
mPlayPauseButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
togglePlayPause
()));
connect
(
mPlayPauseButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
togglePlayPause
()));
...
@@ -108,7 +110,7 @@ void UBGraphicsMediaItemDelegate::buildButtons()
...
@@ -108,7 +110,7 @@ void UBGraphicsMediaItemDelegate::buildButtons()
mToolBarButtons
<<
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
);
mToolBarItem
->
setShifting
(
false
);
mToolBarItem
->
setShifting
(
false
);
...
@@ -122,6 +124,7 @@ void UBGraphicsMediaItemDelegate::buildButtons()
...
@@ -122,6 +124,7 @@ void UBGraphicsMediaItemDelegate::buildButtons()
positionHandles
();
positionHandles
();
}
}
}
UBGraphicsMediaItemDelegate
::~
UBGraphicsMediaItemDelegate
()
UBGraphicsMediaItemDelegate
::~
UBGraphicsMediaItemDelegate
()
...
@@ -149,12 +152,12 @@ void UBGraphicsMediaItemDelegate::positionHandles()
...
@@ -149,12 +152,12 @@ void UBGraphicsMediaItemDelegate::positionHandles()
mToolBarItem
->
setRect
(
toolBarRect
);
mToolBarItem
->
setRect
(
toolBarRect
);
}
}
int
toolBarButtons
=
0
;
int
toolBarButtons
Width
=
0
;
foreach
(
DelegateButton
*
button
,
mToolBarButtons
)
foreach
(
DelegateButton
*
button
,
mToolBarButtons
)
toolBarButtons
+=
button
->
boundingRect
().
width
()
+
mToolBarItem
->
getElementsPadding
();
toolBarButtons
Width
+=
button
->
boundingRect
().
width
()
+
mToolBarItem
->
getElementsPadding
();
QRectF
mediaItemRect
=
mMediaControl
->
rect
();
QRectF
mediaItemRect
=
mMediaControl
->
rect
();
mediaItemRect
.
setWidth
(
mediaItem
->
boundingRect
().
width
()
-
toolBarButtons
);
mediaItemRect
.
setWidth
(
mediaItem
->
boundingRect
().
width
()
-
toolBarButtons
Width
);
mediaItemRect
.
setHeight
(
mToolBarItem
->
boundingRect
().
height
());
mediaItemRect
.
setHeight
(
mToolBarItem
->
boundingRect
().
height
());
mMediaControl
->
setRect
(
mediaItemRect
);
mMediaControl
->
setRect
(
mediaItemRect
);
...
...
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