def tableview_cell_for_row(self, tableview, section, row):
if row >= self.extraRows:
element = self.elements[row-self.extraRows]
cell = ui.TableViewCell('subtitle')
cell.selectable = False
cell.text_label.text = element.get_title()
cell.detail_text_label.text = element.get_description()
cell.background_color=self.thememanager.main_background_colour
cell.image_view.image = ui.Image.named(element.get_icon())
params = element.get_params() or []
selectable = False
for p in params:
if p.display:
selectable = True
cell.accessory_type = 'disclosure_indicator'
cell.selectable = selectable
if self.currentElementNumber >= self.extraRows:
cell.selectable = False
if self.currentElementNumber+1 == row:
cell.background_color = self.thememanager.running_cell_background_colour
cell.text_label.text_color = self.thememanager.running_cell_text_colour
cell.detail_text_label.text_color = self.thememanager.running_cell_text_colour
else:
cell.background_color = self.thememanager.main_background_colour
cell.text_label.text_color = self.thememanager.main_text_colour
cell.detail_text_label.text_color = self.thememanager.main_text_colour
return cell
elif row == self.adminRow:
cell = ui.TableViewCell()
cell.background_color=self.thememanager.main_background_colour
cell.selectable = False
editButton = ui.Button(title='Done' if tableview.editing else 'Edit')
editButton.width *= 1.4
editButton.action = swap_edit
editButton.y = cell.height/2 - editButton.height/2
editButton.x = cell.width
cell.add_subview(editButton)
self.titleButton.y = cell.height/2 - editButton.height/2
self.titleButton.x = self.titleButton.width/2
self.titleButton.action = self.change_title
cell.add_subview(self.titleButton)
return cell
elif row == self.typeRow:
cell = ui.TableViewCell('value1')
cell.background_color=self.thememanager.main_background_colour
cell.selectable = True
cell.text_label.text_color = self.thememanager.main_text_colour
cell.detail_text_label.text_color = self.thememanager.main_text_colour
cell.text_label.text = 'Type of Flow'
cell.detail_text_label.text = self.flowType
return cell
评论列表
文章目录