summaryrefslogtreecommitdiff
path: root/LibGUI/GTableView.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-03-15 17:37:13 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-03-15 17:37:13 +0100
commit1fc283ed7dc504a519db57d442f498e3c803586b (patch)
tree69f383daf37a3e7d453f0a72068afd50a37af438 /LibGUI/GTableView.cpp
parentad08165a252d096ba7e4730efce9fb96181b5373 (diff)
downloadserenity-1fc283ed7dc504a519db57d442f498e3c803586b.zip
IRCClient+LibGUI: Add an input box so we can send messages to channels.
Implement this using a GTextEditor with a special single-line mode. This new mode needs some polishing, but it's already very useful.
Diffstat (limited to 'LibGUI/GTableView.cpp')
-rw-r--r--LibGUI/GTableView.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/LibGUI/GTableView.cpp b/LibGUI/GTableView.cpp
index 2934ab4910..d5212bed0f 100644
--- a/LibGUI/GTableView.cpp
+++ b/LibGUI/GTableView.cpp
@@ -167,6 +167,7 @@ void GTableView::paint_event(GPaintEvent& event)
for (int column_index = 0; column_index < m_model->column_count(); ++column_index) {
auto column_metadata = m_model->column_metadata(column_index);
int column_width = column_metadata.preferred_width;
+ const Font& font = column_metadata.font ? *column_metadata.font : this->font();
bool is_key_column = m_model->key_column() == column_index;
Rect cell_rect(horizontal_padding() + x_offset, y, column_width, item_height());
if (is_key_column) {
@@ -177,7 +178,7 @@ void GTableView::paint_event(GPaintEvent& event)
if (data.is_bitmap())
painter.blit(cell_rect.location(), data.as_bitmap(), data.as_bitmap().rect());
else
- painter.draw_text(cell_rect, data.to_string(), column_metadata.text_alignment, text_color);
+ painter.draw_text(cell_rect, data.to_string(), font, column_metadata.text_alignment, text_color);
x_offset += column_width + horizontal_padding() * 2;
}
++painted_item_index;