← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~springermac/openlp/transparent-display into lp:openlp

 

Jonathan Springer has proposed merging lp:~springermac/openlp/transparent-display into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~springermac/openlp/transparent-display/+merge/233995

This merge proposal is for comment only and contains no added tests.

Add the ability to have a completely transparent display or a display with a transparent background.
-- 
https://code.launchpad.net/~springermac/openlp/transparent-display/+merge/233995
Your team OpenLP Core is requested to review the proposed merge of lp:~springermac/openlp/transparent-display into lp:openlp.
=== modified file 'openlp/core/lib/htmlbuilder.py'
--- openlp/core/lib/htmlbuilder.py	2014-07-21 06:37:41 +0000
+++ openlp/core/lib/htmlbuilder.py	2014-09-09 20:19:02 +0000
@@ -303,6 +303,7 @@
             function show_blank(state){
                 var black = 'none';
                 var lyrics = '';
+                var background = 'black';
                 switch(state){
                     case 'theme':
                         lyrics = 'hidden';
@@ -312,11 +313,19 @@
                         break;
                     case 'desktop':
                         break;
+                    case 'transparent-theme':
+                        background = 'transparent';
+                        break;
+                    case 'transparent-display':
+                        lyrics = 'hidden';
+                        background = 'transparent';
+                        break;
                 }
                 document.getElementById('black').style.display = black;
                 document.getElementById('lyricsmain').style.visibility = lyrics;
                 document.getElementById('image').style.visibility = lyrics;
                 document.getElementById('footer').style.visibility = lyrics;
+                document.getElementsByTagName('body')[0].style.backgroundColor = background;
             }
 
             function show_footer(footertext){
@@ -469,6 +478,7 @@
     function show_blank(state){
         var black = 'none';
         var lyrics = '';
+        var background = 'black';
         switch(state){
             case 'theme':
                 lyrics = 'hidden';
@@ -478,11 +488,19 @@
                 break;
             case 'desktop':
                 break;
+            case 'transparent-theme':
+                background = 'transparent';
+                break;
+            case 'transparent-display':
+                lyrics = 'hidden';
+                background = 'transparent';
+                break;
         }
         document.getElementById('black').style.display = black;
         document.getElementById('lyricsmain').style.visibility = lyrics;
         document.getElementById('image').style.visibility = lyrics;
         document.getElementById('footer').style.visibility = lyrics;
+        document.getElementsByTagName('body')[0].style.backgroundColor = background;
     }
 
     function show_footer(footertext){

=== modified file 'openlp/core/ui/__init__.py'
--- openlp/core/ui/__init__.py	2014-02-27 21:39:44 +0000
+++ openlp/core/ui/__init__.py	2014-09-09 20:19:02 +0000
@@ -49,6 +49,8 @@
     Blank = 1
     Theme = 2
     Screen = 3
+    TransparentTheme = 4
+    TransparentDisplay = 5
 
 
 class AlertLocation(object):

=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2014-08-27 23:18:06 +0000
+++ openlp/core/ui/maindisplay.py	2014-09-09 20:19:02 +0000
@@ -427,6 +427,12 @@
         if mode == HideMode.Screen:
             self.frame.evaluateJavaScript('show_blank("desktop");')
             self.setVisible(False)
+        elif mode == HideMode.TransparentTheme:
+            self.frame.evaluateJavaScript('show_blank("transparent-theme");')
+            self.set_transparency(True)
+        elif mode == HideMode.TransparentDisplay:
+            self.frame.evaluateJavaScript('show_blank("transparent-display");')
+            self.set_transparency(True)
         elif mode == HideMode.Blank or self.initial_fame:
             self.frame.evaluateJavaScript('show_blank("black");')
         else:

=== modified file 'tests/functional/openlp_core_lib/test_htmlbuilder.py'
--- tests/functional/openlp_core_lib/test_htmlbuilder.py	2014-07-24 21:57:16 +0000
+++ tests/functional/openlp_core_lib/test_htmlbuilder.py	2014-09-09 20:19:02 +0000
@@ -79,6 +79,7 @@
     function show_blank(state){
         var black = 'none';
         var lyrics = '';
+        var background = 'black';
         switch(state){
             case 'theme':
                 lyrics = 'hidden';
@@ -88,11 +89,19 @@
                 break;
             case 'desktop':
                 break;
+            case 'transparent-theme':
+                background = 'transparent';
+                break;
+            case 'transparent-display':
+                lyrics = 'hidden';
+                background = 'transparent';
+                break;
         }
         document.getElementById('black').style.display = black;
         document.getElementById('lyricsmain').style.visibility = lyrics;
         document.getElementById('image').style.visibility = lyrics;
         document.getElementById('footer').style.visibility = lyrics;
+        document.getElementsByTagName('body')[0].style.backgroundColor = background;
     }
 
     function show_footer(footertext){


Follow ups