Hide PIP when we have a PIG screen
authorLittlesat <Littlesat99@yahoo.com>
Sat, 7 Jun 2014 11:58:06 +0000 (13:58 +0200)
committerLittlesat <Littlesat99@yahoo.com>
Sat, 7 Jun 2014 11:58:06 +0000 (13:58 +0200)
lib/python/Components/Renderer/Pig.py
lib/python/Screens/PictureInPicture.py

index 64ed677..38edad0 100644 (file)
@@ -3,6 +3,7 @@
 ##
 from Renderer import Renderer
 from enigma import eVideoWidget, eSize, ePoint, getDesktop
+from Screens.InfoBar import InfoBar
 
 class Pig(Renderer):
        def __init__(self):
@@ -19,7 +20,7 @@ class Pig(Renderer):
        def applySkin(self, desktop, parent):
                ret = Renderer.applySkin(self, desktop, parent)
                if ret:
-                       self.Position = self.instance.position() # fixme, scaling!
+                       self.Position = self.instance.position()
                        self.Size = self.instance.size()
                return ret
 
@@ -29,7 +30,13 @@ class Pig(Renderer):
                                self.instance.resize(self.Size)
                        if self.Position:
                                self.instance.move(self.Position)
+                       InfoBarInstance = InfoBar.instance
+                       if InfoBarInstance and InfoBarInstance.session.pipshown:
+                               InfoBarInstance.session.pip.pigmode()
 
        def onHide(self):
                if self.instance:
                        self.preWidgetRemove(self.instance)
+                       InfoBarInstance = InfoBar.instance
+                       if InfoBarInstance and InfoBarInstance.session.pipshown:
+                               InfoBarInstance.session.pip.relocate()
index 29333fd..121a77c 100644 (file)
@@ -43,6 +43,11 @@ class PictureInPicture(Screen):
                self.setExternalPiP(False)
                self.setSizePosMainWindow()
 
+       def pigmode(self):
+               self.instance.resize(eSize(*(1, 1)))
+               self["video"].instance.resize(eSize(*(1, 1)))
+               self.instance.move(ePoint(0, 0))
+
        def relocate(self):
                x = config.av.pip.value[0]
                y = config.av.pip.value[1]