Added general background_color option to table_design

This commit is contained in:
Maximilian Giller 2019-03-24 21:09:10 +01:00
parent 99bba341a9
commit 86c64eeba5
2 changed files with 3 additions and 2 deletions

View file

@ -27,7 +27,7 @@ class EventListDesign (DesignEntity):
self.__fill_event_matrix__()
col_hori_alignment = [ 'right', 'left' ]
table_design = TableTextDesign(self.size, font=self.font_family, line_spacing=self.line_spacing, col_spacing=self.col_spacing, text_matrix=self.__event_matrix__, fontsize = self.text_size, column_horizontal_alignments=col_hori_alignment, mask=False, truncate_cols=False, cell_properties=self.__props_matrix__)
table_design = TableTextDesign(self.size, background_color = self.background_color, font=self.font_family, line_spacing=self.line_spacing, col_spacing=self.col_spacing, text_matrix=self.__event_matrix__, fontsize = self.text_size, column_horizontal_alignments=col_hori_alignment, mask=False, truncate_cols=False, cell_properties=self.__props_matrix__)
self.draw_design(table_design)
def __get_formatted_event__ (self, event):

View file

@ -9,8 +9,9 @@ default_props = {
class TableTextDesign (TextDesign):
"""Gets a matrix with text that is than
displayed in a table without borders."""
def __init__ (self, size, text_matrix, max_col_size = None, max_row_size = None, font = None, fontsize = 12, column_horizontal_alignments = [], mask = True, line_spacing = 0, col_spacing = 0, truncate_rows = True, truncate_cols = True, wrap = False, truncate_text=True, truncate_suffix="...", cell_properties=None):
def __init__ (self, size, text_matrix, max_col_size = None, max_row_size = None, font = None, fontsize = 12, column_horizontal_alignments = [], mask = True, line_spacing = 0, col_spacing = 0, truncate_rows = True, truncate_cols = True, wrap = False, truncate_text=True, truncate_suffix="...", cell_properties=None, background_color = "white"):
super(TableTextDesign, self).__init__(size, font=font, fontsize=fontsize, mask=mask)
self.__init_image__(background_color)
self.matrix = text_matrix
self.max_col_size = max_col_size
self.max_row_size = max_row_size