From 86c64eeba59614c4d7a7ecbd43c5a5dcbf574822 Mon Sep 17 00:00:00 2001 From: Max G Date: Sun, 24 Mar 2019 21:09:10 +0100 Subject: [PATCH] Added general background_color option to table_design --- Calendar/EventListDesign.py | 2 +- Calendar/TableTextDesign.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Calendar/EventListDesign.py b/Calendar/EventListDesign.py index f5c8d36..b1c8a41 100644 --- a/Calendar/EventListDesign.py +++ b/Calendar/EventListDesign.py @@ -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): diff --git a/Calendar/TableTextDesign.py b/Calendar/TableTextDesign.py index 427a20c..341d80a 100644 --- a/Calendar/TableTextDesign.py +++ b/Calendar/TableTextDesign.py @@ -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