From: Stefan Pluecken Date: Fri, 5 May 2006 00:37:07 +0000 (+0000) Subject: PiPSetup should be working now X-Git-Tag: 2.6.0~3491 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/340ad36b95c98a5de43d065c435bdcbdf6100fb8 PiPSetup should be working now --- diff --git a/lib/python/Screens/PiPSetup.py b/lib/python/Screens/PiPSetup.py index be66950c..76212089 100644 --- a/lib/python/Screens/PiPSetup.py +++ b/lib/python/Screens/PiPSetup.py @@ -19,7 +19,8 @@ class PiPSetup(Screen): self.orgpos = self.pos self.size = self.pip.getSize() - self.orgsize = self.size + + self.resize = 100 self["text"] = Label(_("Please use direction keys to move the PiP window.\nPress Bouquet +/- to resize the window.\nPress OK to go back to the TV mode or EXIT to cancel the moving.")) @@ -40,33 +41,37 @@ class PiPSetup(Screen): def cancel(self): self.movePiP(self.orgpos[0], self.orgpos[1]) - self.resizePiP(self.orgsize[0], self.orgsize[1]) + self.resizePiP(100) self.close() def movePiP(self, x, y): + if x < 0: + x = 0 + if y < 0: + y = 0 self.pip.move(x, y) self.pos = (x, y) - def resizePiP(self, w, h): + def resizePiP(self, resize): + w = int(self.size[0] * self.resize / 100) + h = int(self.size[1] * self.resize / 100) self.pip.resize(w, h) - self.size = (w, h) + self.resize = resize def up(self): - self.movePiP(self.pos[0], self.pos[1] - 1) + self.movePiP(self.pos[0], self.pos[1] - 10) def down(self): - self.movePiP(self.pos[0], self.pos[1] + 1) + self.movePiP(self.pos[0], self.pos[1] + 10) def left(self): - self.movePiP(self.pos[0] - 1, self.pos[1]) + self.movePiP(self.pos[0] - 10, self.pos[1]) def right(self): - self.movePiP(self.pos[0] + 1, self.pos[1]) + self.movePiP(self.pos[0] + 10, self.pos[1]) def bigger(self): - # just for testing... TODO resize with correct aspect ratio - self.resizePiP(self.size[0] + 1, self.size[1] + 1) + self.resizePiP(self.resize + 5) def smaller(self): - # just for testing... TODO resize with correct aspect ratio - self.resizePiP(self.size[0] - 1, self.size[1] - 1) \ No newline at end of file + self.resizePiP(self.resize - 5) \ No newline at end of file diff --git a/lib/python/Screens/PictureInPicture.py b/lib/python/Screens/PictureInPicture.py index 8bf78cfb..403ecd3d 100644 --- a/lib/python/Screens/PictureInPicture.py +++ b/lib/python/Screens/PictureInPicture.py @@ -16,6 +16,7 @@ class PictureInPicture(Screen): def resize(self, w, h): print "resizing pip to", str(w) + "x" + str(h) self.instance.resize(eSize(*(w, h))) + self["video"].instance.resize(eSize(*(w, h))) def getPosition(self): return ((self.instance.position().x(), self.instance.position().y()))