Permalink
Browse files

OSD: Fix alpha calculation of expirable windows

  • Loading branch information...
1 parent 2b3bd21 commit 82318f6384e9b1ec8101d48ed62dd29254263db6 @natanojl natanojl committed Aug 13, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 mythtv/libs/libmythtv/osd.cpp
View
12 mythtv/libs/libmythtv/osd.cpp
@@ -609,7 +609,7 @@ bool OSD::DrawDirect(MythPainter* painter, QSize size, bool repaint)
bool visible = false;
bool redraw = m_Refresh;
m_Refresh = false;
- QTime now = QTime::currentTime();
+ QDateTime now = MythDate::current();
CheckExpiry();
QMap<QString,MythScreenType*>::const_iterator it;
@@ -621,7 +621,7 @@ bool OSD::DrawDirect(MythPainter* painter, QSize size, bool repaint)
it.value()->Pulse();
if (m_Effects && m_ExpireTimes.contains(it.value()))
{
- QTime expires = m_ExpireTimes.value(it.value()).time();
+ QDateTime expires = m_ExpireTimes.value(it.value());
int left = now.msecsTo(expires);
if (left < m_FadeTime)
(*it)->SetAlpha((255 * left) / m_FadeTime);
@@ -664,7 +664,7 @@ QRegion OSD::Draw(MythPainter* painter, QPaintDevice *device, QSize size,
if (!painter || !device)
return visible;
- QTime now = QTime::currentTime();
+ QDateTime now = MythDate::current();
CheckExpiry();
// first update for alpha pulse and fade
@@ -682,7 +682,7 @@ QRegion OSD::Draw(MythPainter* painter, QPaintDevice *device, QSize size,
it.value()->Pulse();
if (m_Effects && m_ExpireTimes.contains(it.value()))
{
- QTime expires = m_ExpireTimes.value(it.value()).time();
+ QDateTime expires = m_ExpireTimes.value(it.value());
int left = now.msecsTo(expires);
if (left < m_FadeTime)
(*it)->SetAlpha((255 * left) / m_FadeTime);
@@ -990,7 +990,7 @@ void OSD::DialogShow(const QString &window, const QString &text, int updatefor)
{
OverrideUIScale();
MythScreenType *dialog;
-
+
if (window == OSD_DLG_EDITOR)
dialog = new ChannelEditor(m_ParentObject, window.toLatin1());
else if (window == OSD_DLG_CONFIRM)
@@ -1020,7 +1020,7 @@ void OSD::DialogShow(const QString &window, const QString &text, int updatefor)
delete dialog;
return;
}
-
+
RevertUIScale();
}

0 comments on commit 82318f6

Please sign in to comment.