mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 07:48:12 +00:00
GTableView: Elide cell content so it doesn't overflow the cell rect
I originally thought I'd have to implement text clipping in Painter for this, but it seems like I can get away without doing that today. :^) Fixes #390.
This commit is contained in:
parent
b46dbfe7e4
commit
df51014834
1 changed files with 1 additions and 1 deletions
|
@ -263,7 +263,7 @@ void GTableView::paint_event(GPaintEvent& event)
|
|||
text_color = Color::White;
|
||||
else
|
||||
text_color = model()->data(cell_index, GModel::Role::ForegroundColor).to_color(Color::Black);
|
||||
painter.draw_text(cell_rect, data.to_string(), font, column_metadata.text_alignment, text_color);
|
||||
painter.draw_text(cell_rect, data.to_string(), font, column_metadata.text_alignment, text_color, TextElision::Right);
|
||||
}
|
||||
x_offset += column_width + horizontal_padding() * 2;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue