mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
fixed cases when value of tablefield does not need to ellide or word wrap
This commit is contained in:
parent
e9d2bab791
commit
db1e578cd8
1 changed files with 12 additions and 0 deletions
|
|
@ -853,6 +853,18 @@ class TableField(BaseItem):
|
|||
ellide = self.style.get("ellide")
|
||||
max_lines = self.style.get("max-lines")
|
||||
|
||||
font_family = self.style["font-family"]
|
||||
font_size = self.style["font-size"]
|
||||
font_bold = self.style.get("font-bold", False)
|
||||
font_italic = self.style.get("font-italic", False)
|
||||
|
||||
font = FontFactory.get_font(
|
||||
font_family, font_size, font_italic, font_bold
|
||||
)
|
||||
val_width = font.getsize(value)[0]
|
||||
if val_width <= max_width:
|
||||
return value
|
||||
|
||||
if not ellide and not word_wrap:
|
||||
# TODO logging
|
||||
print((
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue