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
1=== modified file 'openlp/core/lib/htmlbuilder.py'
2--- openlp/core/lib/htmlbuilder.py 2012-12-30 19:41:24 +0000
3+++ openlp/core/lib/htmlbuilder.py 2013-09-29 16:05:31 +0000
4@@ -129,9 +129,10 @@
5 }
6
7 function show_text(newtext){
8+ var fade_direction = 0;
9 var match = /-webkit-text-fill-color:[^;\"]+/gi;
10- if(timer != null)
11- clearTimeout(timer);
12+ if (timer != null)
13+ clearInterval(timer);
14 /*
15 QtWebkit bug with outlines and justify causing outline alignment
16 problems. (Bug 859950) Surround each word with a <span> to workaround,
17@@ -150,39 +151,45 @@
18 newtext = '<span>' + newtext + '</span>';
19 }
20 }
21+
22 text_fade('lyricsmain', newtext);
23 text_fade('lyricsoutline', newtext);
24 text_fade('lyricsshadow', newtext.replace(match, ''));
25 if(text_opacity() == 1) return;
26- timer = setTimeout(function(){
27- show_text(newtext);
28+ timer = setInterval(function(){
29+ text_fade('lyricsmain', newtext);
30+ text_fade('lyricsoutline', newtext);
31+ text_fade('lyricsshadow', newtext.replace(match, ''));
32+ if(text_opacity() == 1) clearInterval(timer);
33 }, 100);
34- }
35
36- function text_fade(id, newtext){
37- /*
38- Using -webkit-transition: opacity 1s linear; would have been preferred
39- but it isn't currently quick enough when animating multiple layers of
40- large areas of large text. Therefore do it manually as best we can.
41- Hopefully in the future we can revisit and do more interesting
42- transitions using -webkit-transition and -webkit-transform.
43- However we need to ensure interrupted transitions (quickly change 2
44- slides) still looks pretty and is zippy.
45- */
46- var text = document.getElementById(id);
47- if(text == null) return;
48- if(!transition){
49- text.innerHTML = newtext;
50- return;
51- }
52- if(newtext == text.innerHTML){
53- text.style.opacity = parseFloat(text.style.opacity) + 0.3;
54- if(text.style.opacity > 0.7)
55- text.style.opacity = 1;
56- } else {
57- text.style.opacity = parseFloat(text.style.opacity) - 0.3;
58- if(text.style.opacity <= 0.1){
59+ function text_fade(id, newtext){
60+ /*
61+ Using -webkit-transition: opacity 1s linear; would have been preferred
62+ but it isn't currently quick enough when animating multiple layers of
63+ large areas of large text. Therefore do it manually as best we can.
64+ Hopefully in the future we can revisit and do more interesting
65+ transitions using -webkit-transition and -webkit-transform.
66+ However we need to ensure interrupted transitions (quickly change 2
67+ slides) still looks pretty and is zippy.
68+ */
69+ var text = document.getElementById(id);
70+ if(text == null) return;
71+ if(!transition){
72 text.innerHTML = newtext;
73+ return;
74+ }
75+ if(fade_direction != 1){
76+ text.style.opacity = parseFloat(text.style.opacity) - 0.3;
77+ if(text.style.opacity <= 0.1){
78+ text.innerHTML = newtext;
79+ fade_direction = 1;
80+ }
81+ }else{
82+ text.style.opacity = parseFloat(text.style.opacity) + 0.3;
83+ if(text.style.opacity > 0.7){
84+ text.style.opacity = 1;
85+ }
86 }
87 }
88 }

Subscribers

People subscribed via source and target branches