diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index 05c71e419..5583e2861 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -152,10 +152,6 @@ sup { text_fade('lyricsmain', newtext); text_fade('lyricsoutline', newtext); text_fade('lyricsshadow', newtext.replace(match, '')); - if(text_opacity() == 1) return; - timer = setTimeout(function(){ - show_text(newtext); - }, 100); } function text_fade(id, newtext){ @@ -174,25 +170,18 @@ sup { text.innerHTML = newtext; return; } - if(newtext == text.innerHTML){ - text.style.opacity = parseFloat(text.style.opacity) + 0.3; - if(text.style.opacity > 0.7) - text.style.opacity = 1; - } else { - text.style.opacity = parseFloat(text.style.opacity) - 0.3; - if(text.style.opacity <= 0.1){ - text.innerHTML = newtext; - } - } + text.style.opacity = '0'; + timer = window.setTimeout(function(){bla(text, newtext)}, 1000); } - function text_opacity(){ - var text = document.getElementById('lyricsmain'); - return getComputedStyle(text, '').opacity; + function bla(text, newtext) { + text.innerHTML = newtext; + text.style.opacity = '1'; } function show_text_complete(){ - return (text_opacity() == 1); + var text = document.getElementById('lyricsmain'); + return getComputedStyle(text, '').opacity == 1; } @@ -331,20 +320,25 @@ def build_lyrics_css(item, webkit_ver): z-index: 5; position: absolute; display: table; + -webkit-transition: opacity 0.5s linear; %s } .lyricscell { display: table-cell; word-wrap: break-word; + -webkit-transition: opacity 0.5s linear; %s } .lyricsmain { +-webkit-transition: opacity 0.5s ease-in; %s } .lyricsoutline { +-webkit-transition: opacity 0.5s ease-in; %s } .lyricsshadow { +-webkit-transition: opacity 0.5s ease-in; %s } """ diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 58d832101..47b7a8758 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -76,7 +76,8 @@ class Display(QtGui.QGraphicsView): # time. We need to investigate more how to use OpenGL properly on Mac OS # X. if sys.platform != 'darwin': - self.setViewport(QtOpenGL.QGLWidget()) + pass + #self.setViewport(QtOpenGL.QGLWidget()) def setup(self): """ @@ -353,6 +354,7 @@ class MainDisplay(Display): # Wait for the fade to finish before geting the preview. # Important otherwise preview will have incorrect text if at all! if self.serviceItem.themedata and self.serviceItem.themedata.display_slide_transition: + # FIXME: method does not work. while self.frame.evaluateJavaScript(u'show_text_complete()') == u'false': self.application.process_events() # Wait for the webview to update before getting the preview.