From a1e381a0f87edb396d9c8be90f77fd4bd27024d4 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 16 Aug 2020 16:00:07 +0200 Subject: LibGUI: Move GUI::Model::Role to GUI::ModelRole This is preparation for using ModelRole in the ModelIndex API. --- Libraries/LibGUI/ListView.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Libraries/LibGUI/ListView.cpp') 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); } -- cgit v1.2.3