From 6d66e6b957809767c86a84fa0cae1c0c57fe9a92 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 4 Mar 2013 20:14:36 +0100 Subject: [PATCH] fixed preview --- openlp/core/lib/htmlbuilder.py | 16 ++++++++-------- openlp/core/ui/maindisplay.py | 3 +-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index b9ac74089..de002c6af 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -171,7 +171,7 @@ sup { return; } text.style.opacity = '0'; - timer = window.setTimeout(function(){_show_text(text, new_text)}, 500); + timer = window.setTimeout(function(){_show_text(text, new_text)}, 400); } function _show_text(text, new_text) { @@ -180,11 +180,11 @@ sup { */ text.innerHTML = new_text; text.style.opacity = '1'; + window.setTimeout(function(){timer = null;}, 500); } function show_text_complete(){ - var text = document.getElementById('lyricsmain'); - return getComputedStyle(text, '').opacity == 1; + return (timer == null); } @@ -323,25 +323,25 @@ def build_lyrics_css(item, webkit_ver): z-index: 5; position: absolute; display: table; - -webkit-transition: opacity 0.5s linear; + -webkit-transition: opacity 0.5s ease; %s } .lyricscell { display: table-cell; word-wrap: break-word; - -webkit-transition: opacity 0.5s linear; + -webkit-transition: opacity 0.5s ease; %s } .lyricsmain { --webkit-transition: opacity 0.5s ease-in; +-webkit-transition: opacity 0.5s ease; %s } .lyricsoutline { --webkit-transition: opacity 0.5s ease-in; +-webkit-transition: opacity 0.5s ease; %s } .lyricsshadow { --webkit-transition: opacity 0.5s ease-in; +-webkit-transition: opacity 0.5s ease; %s } """ diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 47b7a8758..bfe223373 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -354,8 +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': + while not self.frame.evaluateJavaScript(u'show_text_complete()'): self.application.process_events() # Wait for the webview to update before getting the preview. # Important otherwise first preview will miss the background !