ServiceList - adapt progressPercentWidth for FullHD skins by divide progressBarWidth...
[openblackhole/openblackhole-enigma2.git] / lib / python / Components / ServiceList.py
index 8639f2e..661cd01 100644 (file)
@@ -54,6 +54,7 @@ class ServiceList(HTMLComponent, GUIComponent):
                self.ServiceInfoFont = parseFont("Regular;18", ((1,1),(1,1)))
                self.ServiceNumberFont = parseFont("Regular;20", ((1,1),(1,1)))
                self.progressBarWidth = 52
+               self.progressPercentWidth = 52
                self.fieldMargins = 10
 
                self.onSelectionChanged = [ ]
@@ -116,6 +117,8 @@ class ServiceList(HTMLComponent, GUIComponent):
                        self.l.setProgressbarBorderWidth(int(value))
                def progressBarWidth(value):
                        self.progressBarWidth = int(value)
+               def progressPercentWidth(value):
+                       self.progressPercentWidth = int(value)
                def fieldMargins(value):
                        self.fieldMargins = int(value)
                def nonplayableMargins(value):
@@ -324,12 +327,16 @@ class ServiceList(HTMLComponent, GUIComponent):
 
                self.l.setElementPosition(self.l.celServiceNumber, eRect(0, 0, channelNumberWidth, self.ItemHeight))
 
+               progressWidth = self.progressBarWidth
+               if "perc" in config.usage.show_event_progress_in_servicelist.value:
+                       progressWidth = self.progressPercentWidth
+
                if "left" in config.usage.show_event_progress_in_servicelist.value:
-                       self.l.setElementPosition(self.l.celServiceEventProgressbar, eRect(channelNumberWidth+channelNumberSpace, 0, self.progressBarWidth , self.ItemHeight))
-                       self.l.setElementPosition(self.l.celServiceName, eRect(channelNumberWidth+channelNumberSpace + self.progressBarWidth + self.fieldMargins, 0, rowWidth - (channelNumberWidth+channelNumberSpace + self.progressBarWidth + self.fieldMargins), self.ItemHeight))
+                       self.l.setElementPosition(self.l.celServiceEventProgressbar, eRect(channelNumberWidth+channelNumberSpace, 0, progressWidth , self.ItemHeight))
+                       self.l.setElementPosition(self.l.celServiceName, eRect(channelNumberWidth+channelNumberSpace + progressWidth + self.fieldMargins, 0, rowWidth - (channelNumberWidth+channelNumberSpace + progressWidth + self.fieldMargins), self.ItemHeight))
                elif "right" in config.usage.show_event_progress_in_servicelist.value:
-                       self.l.setElementPosition(self.l.celServiceEventProgressbar, eRect(rowWidth - self.progressBarWidth, 0, self.progressBarWidth, self.ItemHeight))
-                       self.l.setElementPosition(self.l.celServiceName, eRect(channelNumberWidth+channelNumberSpace, 0, rowWidth - (channelNumberWidth+channelNumberSpace + self.progressBarWidth + self.fieldMargins), self.ItemHeight))
+                       self.l.setElementPosition(self.l.celServiceEventProgressbar, eRect(rowWidth - progressWidth, 0, progressWidth, self.ItemHeight))
+                       self.l.setElementPosition(self.l.celServiceName, eRect(channelNumberWidth+channelNumberSpace, 0, rowWidth - (channelNumberWidth+channelNumberSpace + progressWidth + self.fieldMargins), self.ItemHeight))
                else:
                        self.l.setElementPosition(self.l.celServiceEventProgressbar, eRect(0, 0, 0, 0))
                        self.l.setElementPosition(self.l.celServiceName, eRect(channelNumberWidth+channelNumberSpace, 0, rowWidth - (channelNumberWidth+channelNumberSpace), self.ItemHeight))