fix ui of plugins on 750s.
[vuplus_dvbapp] / lib / python / Plugins / Extensions / WebBrowser / plugin.py
index 7626007..344f698 100644 (file)
@@ -33,7 +33,7 @@ from Screens.MessageBox import MessageBox
 from Screens.DefaultWizard import DefaultWizard
 from Screens.InfoBarGenerics import InfoBarNotifications
 
-from enigma import eTimer, eServiceReference, iPlayableService, fbClass, eRCInput, eConsoleAppContainer
+from enigma import eTimer, eServiceReference, iPlayableService, fbClass, eRCInput, eConsoleAppContainer, getDesktop
 
 HTTPConnection.debuglevel = 1
 
@@ -88,8 +88,10 @@ def wb_islock():
        return lock
 
 class VuPlayer(Screen, InfoBarNotifications):
+       size = getDesktop(0).size()
+       position_params = size.width() > 750 and (620) or (480)
        skin =  """
-               <screen name="VuPlayer" flags="wfNoBorder" position="center,620" size="455,53" title="VuPlayer" backgroundColor="transparent">
+               <screen name="VuPlayer" flags="wfNoBorder" position="center,%d" size="455,53" title="VuPlayer" backgroundColor="transparent">
                        <ePixmap pixmap="Vu_HD/mp_wb_background.png" position="0,0" zPosition="-1" size="455,53" />
                        <ePixmap pixmap="Vu_HD/icons/mp_wb_buttons.png" position="40,23" size="30,13" alphatest="on" />
 
@@ -105,7 +107,8 @@ class VuPlayer(Screen, InfoBarNotifications):
                                <convert type="ServicePosition">Length</convert>
                        </widget>
                </screen>
-               """
+               """ % position_params
+
        PLAYER_IDLE     = 0
        PLAYER_PLAYING  = 1
        PLAYER_PAUSED   = 2
@@ -404,8 +407,10 @@ class VuPlayerService:
                conn.close()
 
 class BrowserLauncher(ConfigListScreen, Screen):
+       size = getDesktop(0).size()
+       position_params = size.width() > 750 and (309,498, 0,150, 0,455) or (618,320, 312,5, 0,180)
        skin=   """
-               <screen name="BrowserLauncher" position="center,center" size="309,498" title="Web Browser">
+               <screen name="BrowserLauncher" position="center,center" size="%d,%d" title="Web Browser">
                        <ePixmap pixmap="Vu_HD/buttons/red.png" position="4,0" size="40,40" alphatest="on" />
                        <ePixmap pixmap="Vu_HD/buttons/green.png" position="154,0" size="40,40" alphatest="on" />
 
@@ -413,10 +418,10 @@ class BrowserLauncher(ConfigListScreen, Screen):
                        <widget source="key_green" render="Label" position="180,0" zPosition="1" size="125,30" font="Regular;20" halign="center" valign="center" transparent="1" />
 
                        <widget name="config" position="0,50" size="309,100" scrollbarMode="showOnDemand" />
-                       <ePixmap pixmap="Vu_HD/rc_wb_desc.png" position="0,150" size="309,296" alphatest="on" />
-                       <widget name="info" position="0,455" size="309,50" font="Regular;18" halign="center" foregroundColor="blue" transparent="1" />
+                       <ePixmap pixmap="Vu_HD/rc_wb_desc.png" position="%d,%d" size="309,296" alphatest="on" />
+                       <widget name="info" position="%d,%d" size="309,50" font="Regular;18" halign="center" foregroundColor="blue" transparent="1" />
                </screen>
-               """
+               """ % position_params
 
        def __init__(self, session): 
                Screen.__init__(self, session)