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
1f036519
Commit
1f036519
authored
Mar 11, 2013
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: EPGRuler: simplify color change case.
fixes behavior when hour == day change
parent
d40d7cfb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
20 deletions
+8
-20
modules/gui/qt4/components/epg/EPGRuler.cpp
modules/gui/qt4/components/epg/EPGRuler.cpp
+8
-20
No files found.
modules/gui/qt4/components/epg/EPGRuler.cpp
View file @
1f036519
...
@@ -75,7 +75,6 @@ void EPGRuler::paintEvent( QPaintEvent *event )
...
@@ -75,7 +75,6 @@ void EPGRuler::paintEvent( QPaintEvent *event )
QDateTime
localStartTime
;
QDateTime
localStartTime
;
localStartTime
=
m_startTime
.
addSecs
(
m_offset
/
m_scale
);
localStartTime
=
m_startTime
.
addSecs
(
m_offset
/
m_scale
);
const
QString
currentDate
=
localStartTime
.
date
().
toString
();
QDateTime
diff
(
localStartTime
);
QDateTime
diff
(
localStartTime
);
diff
.
setTime
(
QTime
(
localStartTime
.
time
().
hour
(),
0
,
0
,
0
)
);
diff
.
setTime
(
QTime
(
localStartTime
.
time
().
hour
(),
0
,
0
,
0
)
);
...
@@ -88,31 +87,20 @@ void EPGRuler::paintEvent( QPaintEvent *event )
...
@@ -88,31 +87,20 @@ void EPGRuler::paintEvent( QPaintEvent *event )
QDateTime
current
(
localStartTime
.
addSecs
(
secondsToHour
)
);
QDateTime
current
(
localStartTime
.
addSecs
(
secondsToHour
)
);
current
=
current
.
addSecs
(
-
3600
);
current
=
current
.
addSecs
(
-
3600
);
QPalette
::
ColorRole
fillColorRole
;
QColor
fillColor
;
if
(
localStartTime
.
date
().
daysTo
(
current
.
date
()
)
%
2
==
0
)
fillColorRole
=
QPalette
::
Window
;
else
fillColorRole
=
QPalette
::
Dark
;
QColor
fillColor
=
palette
().
color
(
fillColorRole
);
while
(
here
.
rx
()
<
width
()
+
spacing
)
while
(
here
.
rx
()
<
width
()
+
spacing
)
{
{
QRect
area
(
QPoint
(
previous
.
x
()
+
1
,
margin
.
height
()
),
here
);
QRect
area
(
QPoint
(
previous
.
x
()
+
1
,
margin
.
height
()
),
here
);
area
.
adjust
(
0
,
0
,
0
,
header
.
height
()
);
area
.
adjust
(
0
,
0
,
0
,
header
.
height
()
);
QString
timeString
=
current
.
toString
(
"hh'h'"
);
QString
timeString
=
current
.
toString
(
"hh'h'"
);
localStartTime
.
date
().
daysTo
(
current
.
date
()
);
if
(
current
.
time
().
hour
()
==
0
&&
current
.
date
().
toString
()
!=
currentDate
)
{
/* Show Day */
/* Show Day */
if
(
current
.
time
().
hour
()
==
0
)
timeString
+=
current
.
date
().
toString
(
" ddd dd"
);
timeString
+=
current
.
date
().
toString
(
" ddd dd"
);
/* And switch colors */
if
(
fillColorRole
==
QPalette
::
Dark
)
if
(
m_startTime
.
date
().
daysTo
(
current
.
date
()
)
%
2
==
0
)
fillColorRole
=
QPalette
::
Window
;
fillColor
=
palette
().
color
(
QPalette
::
Window
)
;
else
else
fillColorRole
=
QPalette
::
Dark
;
fillColor
=
palette
().
color
(
QPalette
::
Dark
);
fillColor
=
palette
().
color
(
fillColorRole
);
}
p
.
fillRect
(
area
,
fillColor
);
p
.
fillRect
(
area
,
fillColor
);
p
.
drawLine
(
area
.
topRight
(),
area
.
bottomRight
()
);
p
.
drawLine
(
area
.
topRight
(),
area
.
bottomRight
()
);
p
.
drawText
(
area
,
Qt
::
AlignLeft
,
timeString
);
p
.
drawText
(
area
,
Qt
::
AlignLeft
,
timeString
);
...
...
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