Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
acd15b3e
Commit
acd15b3e
authored
Sep 10, 2009
by
Ludovic Fauvet
Browse files
Timeline: desuglyfication
Remove those horribles colors in tracks and do something smoother.
parent
ced48ed7
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/GUI/GraphicsTrack.hpp
View file @
acd15b3e
...
...
@@ -41,6 +41,7 @@ public:
{
m_type
=
type
;
m_trackNumber
=
trackNumber
;
setZValue
(
1
);
}
quint32
trackNumber
()
{
...
...
@@ -51,12 +52,17 @@ public:
protected:
virtual
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
,
QWidget
*
=
0
)
{
/*
Debugging of tracks.
Do not remove this block.
if ( m_type == Video )
painter->setBrush( Qt::green );
else
painter->setBrush( Qt::blue );
painter->setPen( Qt::transparent );
painter->drawRect( rect() );
*/
}
private:
...
...
src/GUI/TracksView.cpp
View file @
acd15b3e
...
...
@@ -444,12 +444,27 @@ void TracksView::resizeEvent( QResizeEvent* event )
void
TracksView
::
drawBackground
(
QPainter
*
painter
,
const
QRectF
&
rect
)
{
// Draw the tracks separators
painter
->
setPen
(
QPen
(
QColor
(
72
,
72
,
72
)
)
);
QList
<
QGraphicsItem
*>
gi
=
items
(
0
,
0
,
1
,
sceneRect
().
height
()
);
for
(
int
i
=
0
;
i
<
gi
.
count
();
++
i
)
{
GraphicsTrack
*
track
=
qgraphicsitem_cast
<
GraphicsTrack
*>
(
gi
.
at
(
i
)
);
if
(
!
track
)
continue
;
if
(
track
->
trackNumber
()
==
0
)
continue
;
QRectF
trackRect
=
track
->
mapRectToScene
(
track
->
boundingRect
()
);
painter
->
drawLine
(
trackRect
.
left
(),
trackRect
.
bottom
(),
rect
.
right
(),
trackRect
.
bottom
()
);
}
// Audio/Video separator
QRectF
r
=
rect
;
r
.
setWidth
(
r
.
width
()
+
1
);
painter
->
setWorldMatrixEnabled
(
false
);
painter
->
setBrush
(
QBrush
(
palette
().
dark
().
color
(),
Qt
::
Dense3Pattern
)
);
painter
->
setPen
(
Qt
::
transparent
);
painter
->
drawRect
(
(
int
)
r
.
left
(),
(
int
)
m_separator
->
y
()
,
painter
->
drawRect
(
(
int
)
r
.
left
(),
(
int
)
m_separator
->
y
()
+
2
,
//FIXME this is a hack
(
int
)
r
.
right
(),
(
int
)
m_separator
->
boundingRect
().
height
()
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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