Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
d854ccd9
Commit
d854ccd9
authored
Mar 04, 2011
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: EPGItem: style with gradient
parent
24495089
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
modules/gui/qt4/components/epg/EPGItem.cpp
modules/gui/qt4/components/epg/EPGItem.cpp
+9
-8
No files found.
modules/gui/qt4/components/epg/EPGItem.cpp
View file @
d854ccd9
...
...
@@ -54,6 +54,9 @@ QRectF EPGItem::boundingRect() const
void
EPGItem
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
)
{
QPen
pen
;
QColor
gradientColor
;
QLinearGradient
gradient
(
m_boundingRect
.
topLeft
(),
m_boundingRect
.
bottomLeft
()
);
// Draw in view's coordinates
painter
->
setWorldMatrixEnabled
(
false
);
...
...
@@ -65,15 +68,12 @@ void EPGItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *option,
QRectF
mapped
=
deviceTransform
(
viewPortTransform
).
mapRect
(
boundingRect
()
);
if
(
m_current
)
{
painter
->
setBrush
(
QBrush
(
QColor
(
244
,
102
,
146
)
)
);
pen
.
setColor
(
QColor
(
244
,
102
,
146
)
);
}
gradientColor
.
setRgb
(
244
,
102
,
146
);
else
{
painter
->
setBrush
(
QBrush
(
QColor
(
201
,
217
,
242
)
)
);
pen
.
setColor
(
QColor
(
201
,
217
,
242
)
);
}
gradientColor
.
setRgb
(
201
,
217
,
242
);
gradient
.
setColorAt
(
0.0
,
gradientColor
.
lighter
(
120
)
);
gradient
.
setColorAt
(
1.0
,
gradientColor
);
pen
.
setColor
(
option
->
state
&
QStyle
::
State_MouseOver
||
hasFocus
()
?
QColor
(
0
,
0
,
0
)
:
QColor
(
192
,
192
,
192
)
);
...
...
@@ -81,6 +81,7 @@ void EPGItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *option,
pen
.
setStyle
(
option
->
state
&
QStyle
::
State_MouseOver
&&
!
hasFocus
()
?
Qt
::
DashLine
:
Qt
::
SolidLine
);
painter
->
setBrush
(
QBrush
(
gradient
)
);
painter
->
setPen
(
pen
);
mapped
.
adjust
(
1
,
2
,
-
1
,
-
2
);
painter
->
drawRoundedRect
(
mapped
,
10
,
10
);
...
...
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