Start to fix preview for fades

This commit is contained in:
Tim Bentley 2010-08-06 06:09:32 +01:00
parent 15c6e47f4e
commit 956017da0e
2 changed files with 10 additions and 1 deletions

View File

@ -46,6 +46,7 @@ HTMLSRC = u"""
<script language="javascript">
var t = null;
var transition = %s;
var fadeComplete = null;
function blankState(state){
var black = 'none';
@ -74,10 +75,12 @@ HTMLSRC = u"""
var text1 = document.getElementById('lyricsmain');
var texto1 = document.getElementById('lyricsoutline');
var texts1 = document.getElementById('lyricsshadow');
fadeComplete = 'false';
if(!transition){
text1.innerHTML = newtext;
texto1.innerHTML = newtext;
texts1.innerHTML = newtext;
fadeComplete = 'true';
return;
}
var text2 = document.getElementById('lyricsmain2');
@ -104,6 +107,7 @@ HTMLSRC = u"""
clearTimeout(t);
t = setTimeout('fade()', 50);
}
function fade(){
var text1 = document.getElementById('lyricsmain');
var texto1 = document.getElementById('lyricsoutline');
@ -131,6 +135,11 @@ HTMLSRC = u"""
texto2.style.opacity = 0
texts2.style.opacity = 0
}
fadeComplete = 'true';
}
function fadeFinsihed(){
return fadeComplete;
}
</script>
</head>

View File

@ -164,6 +164,7 @@ class MainDisplay(DisplayWidget):
log.debug(u'text')
self.frame.evaluateJavaScript("startfade('" +
slide.replace("\\", "\\\\").replace("\'", "\\\'") + "')")
print self.frame.evaluateJavaScript("fadeFinished()").toString()
return self.preview()
def alert(self, text):
@ -274,7 +275,6 @@ class MainDisplay(DisplayWidget):
preview = QtGui.QImage(self.screen[u'size'].width(),
self.screen[u'size'].height(),
QtGui.QImage.Format_ARGB32_Premultiplied)
print self.screen
painter = QtGui.QPainter(preview)
painter.setRenderHint(QtGui.QPainter.Antialiasing)
self.frame.render(painter)