Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
luyikei
VLMC
Commits
fa04538a
Commit
fa04538a
authored
Jun 07, 2009
by
Ludovic Fauvet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the look of clips and tracks
parent
4deb5be2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
7 deletions
+26
-7
src/gui/GraphicsMovieItem.cpp
src/gui/GraphicsMovieItem.cpp
+8
-3
src/gui/TracksView.cpp
src/gui/TracksView.cpp
+2
-2
src/gui/TracksView.h
src/gui/TracksView.h
+16
-2
No files found.
src/gui/GraphicsMovieItem.cpp
View file @
fa04538a
...
...
@@ -20,10 +20,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "GraphicsMovieItem.h"
#include "TracksView.h"
#include <QPainter>
#include <QLinearGradient>
#include <QDebug>
#include "GraphicsMovieItem.h"
#include "TracksView.h"
GraphicsMovieItem
::
GraphicsMovieItem
(
Media
*
media
)
:
m_media
(
media
),
m_width
(
0
),
m_height
(
0
)
{
...
...
@@ -41,7 +42,11 @@ QRectF GraphicsMovieItem::boundingRect() const
void
GraphicsMovieItem
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
,
QWidget
*
)
{
painter
->
setBrush
(
Qt
::
red
);
QLinearGradient
gradient
(
0
,
0
,
m_width
,
m_height
);
gradient
.
setColorAt
(
0
,
QColor
::
fromRgb
(
32
,
52
,
142
)
);
gradient
.
setColorAt
(
1
,
QColor
::
fromRgb
(
43
,
69
,
181
)
);
painter
->
setBrush
(
QBrush
(
gradient
)
);
painter
->
drawRect
(
boundingRect
()
);
paintAudioSpectrum
(
painter
);
...
...
src/gui/TracksView.cpp
View file @
fa04538a
...
...
@@ -89,7 +89,7 @@ void TracksView::createLayout()
void
TracksView
::
addVideoTrack
()
{
GraphicsTrack
*
track
=
new
GraphicsTrack
();
GraphicsTrack
*
track
=
new
GraphicsTrack
(
GraphicsTrack
::
Video
);
track
->
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Preferred
);
track
->
setPreferredHeight
(
m_tracksHeight
);
track
->
setContentsMargins
(
0
,
0
,
0
,
0
);
...
...
@@ -99,7 +99,7 @@ void TracksView::addVideoTrack()
void
TracksView
::
addAudioTrack
()
{
GraphicsTrack
*
track
=
new
GraphicsTrack
();
GraphicsTrack
*
track
=
new
GraphicsTrack
(
GraphicsTrack
::
Audio
);
track
->
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Preferred
);
track
->
setPreferredHeight
(
m_tracksHeight
);
track
->
setContentsMargins
(
0
,
0
,
0
,
0
);
...
...
src/gui/TracksView.h
View file @
fa04538a
...
...
@@ -41,15 +41,29 @@ class GraphicsTrack : public QGraphicsWidget
Q_OBJECT
public:
GraphicsTrack
(
QGraphicsItem
*
parent
=
0
)
:
QGraphicsWidget
(
parent
)
{}
enum
Type
{
Video
,
Audio
};
GraphicsTrack
(
Type
type
,
QGraphicsItem
*
parent
=
0
)
:
QGraphicsWidget
(
parent
)
{
m_type
=
type
;
}
protected:
virtual
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
,
QWidget
*
=
0
)
{
if
(
m_type
==
Video
)
painter
->
setBrush
(
Qt
::
green
);
else
painter
->
setBrush
(
Qt
::
blue
);
painter
->
setPen
(
Qt
::
transparent
);
painter
->
setBrush
(
Qt
::
cyan
);
painter
->
drawRect
(
rect
()
);
}
private:
Type
m_type
;
};
class
TracksView
:
public
QGraphicsView
...
...
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