diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-07-21 00:14:15 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-07-21 00:14:15 +0000 |
| commit | db2fb2d1b2d807cc389a429881886d4a40e763e1 (patch) | |
| tree | e094c8ecb177bcb30fd674bbc16b4dbab74c519a /lib/python/Screens/PictureInPicture.py | |
| parent | 5e9af99815e94c739e4b13b04f4af74e77074d96 (diff) | |
| download | enigma2-db2fb2d1b2d807cc389a429881886d4a40e763e1.tar.gz enigma2-db2fb2d1b2d807cc389a429881886d4a40e763e1.zip | |
store and re-use previous pip position and size
Diffstat (limited to 'lib/python/Screens/PictureInPicture.py')
| -rw-r--r-- | lib/python/Screens/PictureInPicture.py | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/lib/python/Screens/PictureInPicture.py b/lib/python/Screens/PictureInPicture.py index 20cdb236..fdb04185 100644 --- a/lib/python/Screens/PictureInPicture.py +++ b/lib/python/Screens/PictureInPicture.py @@ -1,21 +1,36 @@ from Screens.Screen import Screen from enigma import ePoint, eSize, eServiceCenter - from Components.VideoWindow import VideoWindow +from Components.config import config, configElement, configSequence, configsequencearg class PictureInPicture(Screen): def __init__(self, session): Screen.__init__(self, session) - self["video"] = VideoWindow() self.currentService = None + config.av.pip = configElement("config.av.pip", configSequence, [-1, -1, -1, -1], configsequencearg.get("POSITION", (719, 567, 720, 568))) + self.onLayoutFinish.append(self.LayoutFinished) + + def LayoutFinished(self): + self.onLayoutFinish.remove(self.LayoutFinished) + x = config.av.pip.value[0] + y = config.av.pip.value[1] + w = config.av.pip.value[2] + h = config.av.pip.value[3] + if x != -1 and y != -1 and w != -1 and h != -1: + self.move(x, y) + self.resize(w, h) def move(self, x, y): - print "moving pip to", str(x) + ":" + str(y) + config.av.pip.value[0] = x + config.av.pip.value[1] = y + config.av.pip.save() self.instance.move(ePoint(x, y)) def resize(self, w, h): - print "resizing pip to", str(w) + "x" + str(h) + config.av.pip.value[2] = w + config.av.pip.value[3] = h + config.av.pip.save() self.instance.resize(eSize(*(w, h))) self["video"].instance.resize(eSize(*(w, h))) |
