Merge lp:~oliwee/openlp/bug-1223841 into lp:openlp/2.0

Proposed by Oliver Wieland
Status: Merged
Approved by: Jonathan Corwin
Approved revision: 2169
Merged at revision: 2172
Proposed branch: lp:~oliwee/openlp/bug-1223841
Merge into: lp:openlp/2.0
Diff against target: 88 lines (+35/-28)
1 file modified
openlp/core/lib/htmlbuilder.py (+35/-28)
To merge this branch: bzr merge lp:~oliwee/openlp/bug-1223841
Reviewer Review Type Date Requested Status
Jonathan Corwin (community) Approve
Raoul Snyman Approve
Andreas Preikschat Pending
Review via email: mp+188229@code.launchpad.net

This proposal supersedes a proposal from 2013-09-12.

Description of the change

reimplements the fade out/in on slide changes for transition between two identical slides.

To post a comment you must log in.
Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

Oli, you *must* add a description to a merge proposal. I don't always have the time to go reading all your commit logs to determine what your merge proposal is doing.

Revision history for this message
Raoul Snyman (raoul-snyman) :
review: Approve
Revision history for this message
Jonathan Corwin (j-corwin) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openlp/core/lib/htmlbuilder.py'
--- openlp/core/lib/htmlbuilder.py 2012-12-30 19:41:24 +0000
+++ openlp/core/lib/htmlbuilder.py 2013-09-29 16:05:31 +0000
@@ -129,9 +129,10 @@
129 }129 }
130130
131 function show_text(newtext){131 function show_text(newtext){
132 var fade_direction = 0;
132 var match = /-webkit-text-fill-color:[^;\"]+/gi;133 var match = /-webkit-text-fill-color:[^;\"]+/gi;
133 if(timer != null)134 if (timer != null)
134 clearTimeout(timer);135 clearInterval(timer);
135 /*136 /*
136 QtWebkit bug with outlines and justify causing outline alignment137 QtWebkit bug with outlines and justify causing outline alignment
137 problems. (Bug 859950) Surround each word with a <span> to workaround,138 problems. (Bug 859950) Surround each word with a <span> to workaround,
@@ -150,39 +151,45 @@
150 newtext = '<span>' + newtext + '</span>';151 newtext = '<span>' + newtext + '</span>';
151 }152 }
152 }153 }
154
153 text_fade('lyricsmain', newtext);155 text_fade('lyricsmain', newtext);
154 text_fade('lyricsoutline', newtext);156 text_fade('lyricsoutline', newtext);
155 text_fade('lyricsshadow', newtext.replace(match, ''));157 text_fade('lyricsshadow', newtext.replace(match, ''));
156 if(text_opacity() == 1) return;158 if(text_opacity() == 1) return;
157 timer = setTimeout(function(){159 timer = setInterval(function(){
158 show_text(newtext);160 text_fade('lyricsmain', newtext);
161 text_fade('lyricsoutline', newtext);
162 text_fade('lyricsshadow', newtext.replace(match, ''));
163 if(text_opacity() == 1) clearInterval(timer);
159 }, 100);164 }, 100);
160 }
161165
162 function text_fade(id, newtext){166 function text_fade(id, newtext){
163 /*167 /*
164 Using -webkit-transition: opacity 1s linear; would have been preferred168 Using -webkit-transition: opacity 1s linear; would have been preferred
165 but it isn't currently quick enough when animating multiple layers of169 but it isn't currently quick enough when animating multiple layers of
166 large areas of large text. Therefore do it manually as best we can.170 large areas of large text. Therefore do it manually as best we can.
167 Hopefully in the future we can revisit and do more interesting171 Hopefully in the future we can revisit and do more interesting
168 transitions using -webkit-transition and -webkit-transform.172 transitions using -webkit-transition and -webkit-transform.
169 However we need to ensure interrupted transitions (quickly change 2173 However we need to ensure interrupted transitions (quickly change 2
170 slides) still looks pretty and is zippy.174 slides) still looks pretty and is zippy.
171 */175 */
172 var text = document.getElementById(id);176 var text = document.getElementById(id);
173 if(text == null) return;177 if(text == null) return;
174 if(!transition){178 if(!transition){
175 text.innerHTML = newtext;
176 return;
177 }
178 if(newtext == text.innerHTML){
179 text.style.opacity = parseFloat(text.style.opacity) + 0.3;
180 if(text.style.opacity > 0.7)
181 text.style.opacity = 1;
182 } else {
183 text.style.opacity = parseFloat(text.style.opacity) - 0.3;
184 if(text.style.opacity <= 0.1){
185 text.innerHTML = newtext;179 text.innerHTML = newtext;
180 return;
181 }
182 if(fade_direction != 1){
183 text.style.opacity = parseFloat(text.style.opacity) - 0.3;
184 if(text.style.opacity <= 0.1){
185 text.innerHTML = newtext;
186 fade_direction = 1;
187 }
188 }else{
189 text.style.opacity = parseFloat(text.style.opacity) + 0.3;
190 if(text.style.opacity > 0.7){
191 text.style.opacity = 1;
192 }
186 }193 }
187 }194 }
188 }195 }

Subscribers

People subscribed via source and target branches