summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/ListView.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-08-16 16:00:07 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-16 16:44:09 +0200
commita1e381a0f87edb396d9c8be90f77fd4bd27024d4 (patch)
tree63c8f74e970cdcb091796fceed8064705c2e0098 /Libraries/LibGUI/ListView.cpp
parentf6d7204689a009ce804b56e9e921985d2e61fc19 (diff)
downloadserenity-a1e381a0f87edb396d9c8be90f77fd4bd27024d4.zip
LibGUI: Move GUI::Model::Role to GUI::ModelRole
This is preparation for using ModelRole in the ModelIndex API.
Diffstat (limited to 'Libraries/LibGUI/ListView.cpp')
-rw-r--r--Libraries/LibGUI/ListView.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Libraries/LibGUI/ListView.cpp b/Libraries/LibGUI/ListView.cpp
index 2b3d1785a2..73bea486f1 100644
--- a/Libraries/LibGUI/ListView.cpp
+++ b/Libraries/LibGUI/ListView.cpp
@@ -59,7 +59,7 @@ void ListView::update_content_size()
int content_width = 0;
for (int row = 0, row_count = model()->row_count(); row < row_count; ++row) {
- auto text = model()->data(model()->index(row, m_model_column), Model::Role::Display);
+ auto text = model()->data(model()->index(row, m_model_column), ModelRole::Display);
content_width = max(content_width, font().width(text.to_string()));
}
@@ -162,11 +162,11 @@ void ListView::paint_event(PaintEvent& event)
if (is_selected_row)
text_color = is_focused() ? palette().selection_text() : palette().inactive_selection_text();
else
- text_color = model()->data(index, Model::Role::ForegroundColor).to_color(palette().color(foreground_role()));
+ text_color = model()->data(index, ModelRole::ForegroundColor).to_color(palette().color(foreground_role()));
auto text_rect = row_rect;
text_rect.move_by(horizontal_padding(), 0);
text_rect.set_width(text_rect.width() - horizontal_padding() * 2);
- auto text_alignment = model()->data(index, Model::Role::TextAlignment).to_text_alignment(Gfx::TextAlignment::CenterLeft);
+ auto text_alignment = model()->data(index, ModelRole::TextAlignment).to_text_alignment(Gfx::TextAlignment::CenterLeft);
painter.draw_text(text_rect, data.to_string(), font, text_alignment, text_color);
}