mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 22:38:12 +00:00
LibGUI: Move GUI::Model::Role to GUI::ModelRole
This is preparation for using ModelRole in the ModelIndex API.
This commit is contained in:
parent
f6d7204689
commit
a1e381a0f8
66 changed files with 201 additions and 167 deletions
|
@ -70,16 +70,16 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
virtual GUI::Variant data(const GUI::ModelIndex& index, Role role = Role::Display) const override
|
||||
virtual GUI::Variant data(const GUI::ModelIndex& index, GUI::ModelRole role) const override
|
||||
{
|
||||
if (role == Role::TextAlignment)
|
||||
if (role == GUI::ModelRole::TextAlignment)
|
||||
return Gfx::TextAlignment::CenterLeft;
|
||||
if (role == Role::Font) {
|
||||
if (role == GUI::ModelRole::Font) {
|
||||
if (index.column() == Column::MatchedText)
|
||||
return Gfx::Font::default_fixed_width_font();
|
||||
return {};
|
||||
}
|
||||
if (role == Role::Display) {
|
||||
if (role == GUI::ModelRole::Display) {
|
||||
auto& match = m_matches.at(index.row());
|
||||
switch (index.column()) {
|
||||
case Column::Filename:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue