Added font size to cell properties
This commit is contained in:
parent
a7c7a3e553
commit
d2fa6d8fd7
1 changed files with 5 additions and 2 deletions
|
@ -6,7 +6,8 @@ from DesignEntity import DesignEntity
|
||||||
|
|
||||||
default_props = {
|
default_props = {
|
||||||
"color" : colors["fg"],
|
"color" : colors["fg"],
|
||||||
"background_color" : colors["bg"]
|
"background_color" : colors["bg"],
|
||||||
|
"font-size" : defaultfontsize
|
||||||
}
|
}
|
||||||
|
|
||||||
class TableDesign (TextDesign):
|
class TableDesign (TextDesign):
|
||||||
|
@ -29,6 +30,7 @@ class TableDesign (TextDesign):
|
||||||
self.truncate_text = truncate_text
|
self.truncate_text = truncate_text
|
||||||
self.truncate_suffix = truncate_suffix
|
self.truncate_suffix = truncate_suffix
|
||||||
self.cell_properties = cell_properties
|
self.cell_properties = cell_properties
|
||||||
|
default_props["font-size"] = fontsize
|
||||||
|
|
||||||
def __finish_image__ (self):
|
def __finish_image__ (self):
|
||||||
if len(self.matrix) is 0:
|
if len(self.matrix) is 0:
|
||||||
|
@ -118,8 +120,9 @@ class TableDesign (TextDesign):
|
||||||
def __draw_text__ (self, pos, size, row, col):
|
def __draw_text__ (self, pos, size, row, col):
|
||||||
color = self.__get_cell_prop__(row, col, "color")
|
color = self.__get_cell_prop__(row, col, "color")
|
||||||
bg_color = self.__get_cell_prop__(row, col, "background_color")
|
bg_color = self.__get_cell_prop__(row, col, "background_color")
|
||||||
|
fontsize = self.__get_cell_prop__(row, col, "font-size")
|
||||||
|
|
||||||
design = TextDesign(size, text=self.matrix[row][col], font=self.font_family, color=color, background_color=bg_color, fontsize=self.font_size, horizontalalignment=self.__get_col_hori_alignment__(col), wrap=self.wrap, truncate=self.truncate_text, truncate_suffix=self.truncate_suffix)
|
design = TextDesign(size, text=self.matrix[row][col], font=self.font_family, color=color, background_color=bg_color, fontsize=fontsize, horizontalalignment=self.__get_col_hori_alignment__(col), wrap=self.wrap, truncate=self.truncate_text, truncate_suffix=self.truncate_suffix)
|
||||||
design.pos = pos
|
design.pos = pos
|
||||||
self.draw_design(design)
|
self.draw_design(design)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue