forked from openlp/openlp
Start to fix preview for fades
This commit is contained in:
parent
15c6e47f4e
commit
956017da0e
@ -46,6 +46,7 @@ HTMLSRC = u"""
|
|||||||
<script language="javascript">
|
<script language="javascript">
|
||||||
var t = null;
|
var t = null;
|
||||||
var transition = %s;
|
var transition = %s;
|
||||||
|
var fadeComplete = null;
|
||||||
|
|
||||||
function blankState(state){
|
function blankState(state){
|
||||||
var black = 'none';
|
var black = 'none';
|
||||||
@ -74,10 +75,12 @@ HTMLSRC = u"""
|
|||||||
var text1 = document.getElementById('lyricsmain');
|
var text1 = document.getElementById('lyricsmain');
|
||||||
var texto1 = document.getElementById('lyricsoutline');
|
var texto1 = document.getElementById('lyricsoutline');
|
||||||
var texts1 = document.getElementById('lyricsshadow');
|
var texts1 = document.getElementById('lyricsshadow');
|
||||||
|
fadeComplete = 'false';
|
||||||
if(!transition){
|
if(!transition){
|
||||||
text1.innerHTML = newtext;
|
text1.innerHTML = newtext;
|
||||||
texto1.innerHTML = newtext;
|
texto1.innerHTML = newtext;
|
||||||
texts1.innerHTML = newtext;
|
texts1.innerHTML = newtext;
|
||||||
|
fadeComplete = 'true';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var text2 = document.getElementById('lyricsmain2');
|
var text2 = document.getElementById('lyricsmain2');
|
||||||
@ -104,6 +107,7 @@ HTMLSRC = u"""
|
|||||||
clearTimeout(t);
|
clearTimeout(t);
|
||||||
t = setTimeout('fade()', 50);
|
t = setTimeout('fade()', 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
function fade(){
|
function fade(){
|
||||||
var text1 = document.getElementById('lyricsmain');
|
var text1 = document.getElementById('lyricsmain');
|
||||||
var texto1 = document.getElementById('lyricsoutline');
|
var texto1 = document.getElementById('lyricsoutline');
|
||||||
@ -131,6 +135,11 @@ HTMLSRC = u"""
|
|||||||
texto2.style.opacity = 0
|
texto2.style.opacity = 0
|
||||||
texts2.style.opacity = 0
|
texts2.style.opacity = 0
|
||||||
}
|
}
|
||||||
|
fadeComplete = 'true';
|
||||||
|
}
|
||||||
|
|
||||||
|
function fadeFinsihed(){
|
||||||
|
return fadeComplete;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
@ -164,6 +164,7 @@ class MainDisplay(DisplayWidget):
|
|||||||
log.debug(u'text')
|
log.debug(u'text')
|
||||||
self.frame.evaluateJavaScript("startfade('" +
|
self.frame.evaluateJavaScript("startfade('" +
|
||||||
slide.replace("\\", "\\\\").replace("\'", "\\\'") + "')")
|
slide.replace("\\", "\\\\").replace("\'", "\\\'") + "')")
|
||||||
|
print self.frame.evaluateJavaScript("fadeFinished()").toString()
|
||||||
return self.preview()
|
return self.preview()
|
||||||
|
|
||||||
def alert(self, text):
|
def alert(self, text):
|
||||||
@ -274,7 +275,6 @@ class MainDisplay(DisplayWidget):
|
|||||||
preview = QtGui.QImage(self.screen[u'size'].width(),
|
preview = QtGui.QImage(self.screen[u'size'].width(),
|
||||||
self.screen[u'size'].height(),
|
self.screen[u'size'].height(),
|
||||||
QtGui.QImage.Format_ARGB32_Premultiplied)
|
QtGui.QImage.Format_ARGB32_Premultiplied)
|
||||||
print self.screen
|
|
||||||
painter = QtGui.QPainter(preview)
|
painter = QtGui.QPainter(preview)
|
||||||
painter.setRenderHint(QtGui.QPainter.Antialiasing)
|
painter.setRenderHint(QtGui.QPainter.Antialiasing)
|
||||||
self.frame.render(painter)
|
self.frame.render(painter)
|
||||||
|
Loading…
Reference in New Issue
Block a user