Jump to content


Photo

VolumeText


  • Please log in to reply
No replies to this topic

#1 mrvica

  • Senior Member
  • 558 posts

+28
Good

Posted 27 July 2018 - 21:14

some people like VolumeText on the VolumeBar, this can be achieved by an externel render (VolumeText.py) or directly patching /Screens/Volume.py, patch by vali
from Screen import Screen
from Components.VolumeBar import VolumeBar
from Components.Label import Label #NEW LINE

class Volume(Screen):
	def __init__(self, session):
		Screen.__init__(self, session)

		self.volumeBar = VolumeBar()

		self["Volume"] = self.volumeBar
		self["VolumeText"] = Label("") #NEW LINE

	def setValue(self, vol):
		print "setValue", vol
		self.volumeBar.setValue(vol)
		self["VolumeText"].setText(str(vol)) #NEW LINE

now only a widget is needed in your skin.xml, i.e for a fullhd skin, here volume screen without using any pixmaps (!)

<screen name="Volume" position="center,60" size="773,39" title="Volume" backgroundColor="#ff000000" zPosition="10" flags="wfNoBorder">
    <widget name="Volume" position="0,14" size="681,12" foregroundColor="#2397db" backgroundColor="#ff9c00" />
    <widget name="VolumeText" font="Regular;33" transparent="1" foregroundColor="#ff9c00" borderWidth="3" halign="center" position="698,2" size="75,36" />
</screen>

 






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users