better resizing
[enigma2.git] / data / skin.xml
index 92dfa0bba5ae4f701ebc1960832e619985763a72..2d920f846313ce1a595a87f8930ef5ba5d5de0df 100644 (file)
@@ -21,6 +21,8 @@
                        <color name="ListboxSelectedForeground" color="#ffffff" />
                        <color name="ListboxMarkedBackground" color="#ff0000" />
                        <color name="ListboxMarkedForeground" color="#ffffff" />
+                       <color name="ListboxMarkedAndSelectedBackground" color="#800000" />
+                       <color name="ListboxMarkedAndSelectedForeground" color="#ffffff" />
                        <color name="WindowTitleForeground" color="#ffffff" />
                        <color name="WindowTitleBackground" color="#33294a6b" />
                        <borderset name="bsWindow">
                        <widget name="list" position="0,0" size="560,375" zPosition="1" scrollbarMode="showOnDemand" />
                        <widget name="freeDiskSpace" position="10,380" size="540,30" font="Regular;25" />
                </screen>
-               <screen name="ServiceScan" position="200,100" size="300,300" title="Service Scan">
-                       <widget name="scan_progress" position="10,10" size="300,20" />
-                       <widget name="scan_state" position="10,40" size="280,60" font="Regular;20" />
-                       <widget name="servicelist" position="10,110" size="280,175" selectionDisabled="1" />
+               <screen name="ServiceScan" position="200,100" size="300,330" title="Service Scan">
+                       <widget name="pass" position="10,10" size="280,30" font="Regular;20" />
+                       <widget name="scan_progress" position="10,45" size="280,20" />
+                       <widget name="scan_state" position="10,65" size="280,60" font="Regular;20" />
+                       <widget name="servicelist" position="10,135" size="280,175" selectionDisabled="1" />
                </screen>
-               <screen name="InputBox" position="100,100" size="550,400" title="Input" >
+               <screen name="InputBox" position="100,100" size="550,60" title="Input" >
                        <widget name="text" position="0,0" size="550,25" font="Regular;20" />
                        <widget name="input" position="0,30" size="550,25" font="Regular;20" />
-               </screen>"""
+               </screen>
+               <screen name="ChoiceBox" position="100,100" size="550,400" title="Input" >
+                       <widget name="text" position="0,0" size="550,25" font="Regular;20" />
+                       <widget name="list" position="0,30" size="550,335" scrollbarMode="showOnDemand" />
+                       <applet type="onLayoutFinish">
+# this should be factored out into some helper code, but currently demonstrates applets.
+from enigma import eSize, ePoint
+
+orgwidth = self.instance.size().width()
+orgpos = self.instance.position()
+textsize = self["text"].getSize()
+
+# y size still must be fixed in font stuff...
+textsize = (textsize[0] + 50, textsize[1] + 50)
+count = len(self.list)
+if count > 6:
+       count = 6
+offset = 30 * count
+wsizex = textsize[0] + 60
+wsizey = textsize[1] + offset
+if (400 > wsizex):
+       wsizex = 400
+wsize = (wsizex, wsizey)
+
+
+# resize
+self.instance.resize(eSize(*wsize))
+
+# resize label
+self["text"].instance.resize(eSize(*textsize))
+
+# move list
+listsize = (wsizex, 30 * len(self.list))
+self["list"].instance.move(ePoint(0, textsize[1]))
+self["list"].instance.resize(eSize(*listsize))
+
+# center window
+newwidth = wsize[0]
+self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y()))
+                       </applet>                       
+               </screen>
                <screen name="TimerEdit" position="70,100" size="590,335" title="Timer Edit">
                        <widget name="description" position="10,10" size="580,40" font="Regular;25" />
                        <widget name="lbegin" position="405,102" size="103,30" font="Regular;25" foregroundColor="red" />