def recalcEntrySize(self): esize = self.l.getItemSize() width = esize.width() height = esize.height() self.weekday_rect = Rect(120, -10, 200, 20) self.datetime_rect = Rect(0, 0, 120, 20) self.descr_rect = Rect(0, 22, width, height - 23) self.evCnt = 0
def recalcEntrySize(self): esize = self.l.getItemSize() width = esize.width() height = esize.height() if self.showServiceTitle or not self.showPicon or self.piconSize is None: w = width / 10 * 2 else: w = self.piconSize.width() self.service_rect = Rect(0, 0, w, height) self.event_rect = Rect(w, 0, width - w, height)
def recalcEntrySize(self): esize = self.l.getItemSize() width = esize.width() height = esize.height() xpos = 0 w = width / 10 * 2 self.service_rect = Rect(xpos, 0, w - 10, height) xpos += w w = width / 10 * 8 self.event_rect = Rect(xpos, 0, w, height)
def recalcEntrySize(self): super(EPGSearchList, self).recalcEntrySize() self.listSizeWidth = self.l.getItemSize().width() width = self.descr_rect.x + self.descr_rect.w if allowShowOrbital and config.plugins.epgsearch.showorbital.value: fontSize = self.eventFontSizeSingle + config.epgselection.enhanced_eventfs.value orbitalPosWidth = int(fontSize * 4.4) else: orbitalPosWidth = 0 self.orbpos_rect = Rect(self.descr_rect.x, self.descr_rect.y, orbitalPosWidth, self.descr_rect.h) orbpos_r = self.orbpos_rect.x + self.orbpos_rect.w self.descr_rect = Rect(orbpos_r, self.orbpos_rect.y, width - orbpos_r, self.orbpos_rect.h)
def recalcEntrySize(self): esize = self.l.getItemSize() width = esize.width() height = esize.height() if self.showServiceTitle: w = width // 10 * 2; else: # if self.showPicon: # this must be set if showServiceTitle is None w = 2 * height - 2 * self.serviceBorderWidth # FIXME: could do better... self.service_rect = Rect(0, 0, w, height) self.event_rect = Rect(w, 0, width - w, height) piconHeight = height - 2 * self.serviceBorderWidth piconWidth = 2 * piconHeight # FIXME: could do better... if piconWidth > w - 2 * self.serviceBorderWidth: piconWidth = w - 2 * self.serviceBorderWidth self.picon_size = eSize(piconWidth, piconHeight)
def selEntry(self, dir, visible = True): cur_service = self.cur_service #(service, service_name, events, picon) self.recalcEntrySize() valid_event = self.cur_event is not None if cur_service: update = True entries = cur_service[2] if dir == 0: #current update = False elif dir == +1: #next if valid_event and self.cur_event + 1 < len(entries): self.cur_event += 1 else: self.offs += 1 self.fillMultiEPG(None) # refill return True elif dir == -1: #prev if valid_event and self.cur_event - 1 >= 0: self.cur_event -= 1 elif self.offs > 0: self.offs -= 1 self.fillMultiEPG(None) # refill return True elif dir == +2: #next page self.offs += 1 self.fillMultiEPG(None) # refill return True elif dir == -2: #prev if self.offs > 0: self.offs -= 1 self.fillMultiEPG(None) # refill return True elif dir == +3: #next day self.offs += 60 * 24 / self.time_epoch self.fillMultiEPG(None) # refill return True elif dir == -3: #prev day self.offs -= 60 * 24 / self.time_epoch if self.offs < 0: self.offs = 0; self.fillMultiEPG(None) # refill return True if cur_service and valid_event: entry = entries[self.cur_event] #(event_id, event_title, begin_time, duration) time_base = self.time_base + self.offs*self.time_epoch * 60 xpos, width = self.calcEntryPosAndWidth(self.event_rect, time_base, self.time_epoch, entry[2], entry[3]) self.select_rect = Rect(xpos, 0, width, self.event_rect.height) self.l.setSelectionClip(eRect(xpos, 0, width, self.event_rect.h), visible and update) else: self.select_rect = self.event_rect self.l.setSelectionClip(eRect(self.event_rect.x, self.event_rect.y, self.event_rect.w, self.event_rect.h), False) self.selectionChanged() return False
def getServiceRect(self): rc = self.service_rect return Rect( rc.left() + (self.instance and self.instance.position().x() or 0), rc.top(), rc.width(), rc.height() )
def getEventRect(self): rc = self.event_rect return Rect( rc.left() + (self.instance and self.instance.position().x() or 0), rc.top(), rc.width(), rc.height() )
def recalcEntrySize(self): esize = self.l.getItemSize() width = esize.width() height = esize.height() try: self.iconSize = self.clocks[0].size().height() except: pass self.space = self.iconSize + self.iconDistance self.nextIcon = self.iconSize + 2 * self.iconDistance self.height = height self.dy = int((height - self.iconSize)/2.) if self.type == EPG_TYPE_SINGLE: if self.skinColumns: x = 0 self.weekday_rect = Rect(0, 0, self.gap(self.col[0]), height) x += self.col[0] self.datetime_rect = Rect(x, 0, self.gap(self.col[1]), height) x += self.col[1] self.descr_rect = Rect(x, 0, width-x, height) else: self.weekday_rect = Rect(0, 0, width/20*2-10, height) self.datetime_rect = Rect(width/20*2, 0, width/20*5-15, height) self.descr_rect = Rect(width/20*7, 0, width/20*13, height) elif self.type == EPG_TYPE_MULTI: if self.skinColumns: x = 0 self.service_rect = Rect(x, 0, self.gap(self.col[0]), height) x += self.col[0] self.progress_rect = Rect(x, 8, self.gap(self.col[1]), height-16) self.start_end_rect = Rect(x, 0, self.gap(self.col[1]), height) x += self.col[1] self.descr_rect = Rect(x, 0, width-x, height) else: xpos = 0; w = width/10*3; self.service_rect = Rect(xpos, 0, w-10, height) xpos += w; w = width/10*2; self.start_end_rect = Rect(xpos, 0, w-10, height) self.progress_rect = Rect(xpos, 4, w-10, height-8) xpos += w w = width/10*5; self.descr_rect = Rect(xpos, 0, width, height) else: # EPG_TYPE_SIMILAR if self.skinColumns: x = 0 self.weekday_rect = Rect(0, 0, self.gap(self.col[0]), height) x += self.col[0] self.datetime_rect = Rect(x, 0, self.gap(self.col[1]), height) x += self.col[1] self.descr_rect = Rect(x, 0, width-x, height) else: self.weekday_rect = Rect(0, 0, width/20*2-10, height) self.datetime_rect = Rect(width/20*2, 0, width/20*5-15, height) self.service_rect = Rect(width/20*7, 0, width/20*13, height)