diff options
author | Andreas Kling <kling@serenityos.org> | 2020-05-21 19:36:09 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-21 19:55:44 +0200 |
commit | 2e03bded43344d4dd2d4f19d4d963646aaa77e40 (patch) | |
tree | 28f044c3485c240307abb8c289cbdb28831dfb80 /Applications/IRCClient | |
parent | 3c819b8ff4d8c1cefceeb65ee0e89e3858a11bb5 (diff) | |
download | serenity-2e03bded43344d4dd2d4f19d4d963646aaa77e40.zip |
LibGUI: Add Model::Role::TextAlignment and remove from ColumnMetadata
Diffstat (limited to 'Applications/IRCClient')
-rw-r--r-- | Applications/IRCClient/IRCChannelMemberListModel.cpp | 4 | ||||
-rw-r--r-- | Applications/IRCClient/IRCWindowListModel.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/Applications/IRCClient/IRCChannelMemberListModel.cpp b/Applications/IRCClient/IRCChannelMemberListModel.cpp index ff25503fd8..6e7b9d1fc4 100644 --- a/Applications/IRCClient/IRCChannelMemberListModel.cpp +++ b/Applications/IRCClient/IRCChannelMemberListModel.cpp @@ -61,13 +61,15 @@ GUI::Model::ColumnMetadata IRCChannelMemberListModel::column_metadata(int column { switch (column) { case Column::Name: - return { 70, Gfx::TextAlignment::CenterLeft }; + return { 70 }; } ASSERT_NOT_REACHED(); } GUI::Variant IRCChannelMemberListModel::data(const GUI::ModelIndex& index, Role role) const { + if (role == Role::TextAlignment) + return Gfx::TextAlignment::CenterLeft; if (role == Role::Display) { switch (index.column()) { case Column::Name: diff --git a/Applications/IRCClient/IRCWindowListModel.cpp b/Applications/IRCClient/IRCWindowListModel.cpp index 6b50450203..4c2c227d58 100644 --- a/Applications/IRCClient/IRCWindowListModel.cpp +++ b/Applications/IRCClient/IRCWindowListModel.cpp @@ -63,13 +63,15 @@ GUI::Model::ColumnMetadata IRCWindowListModel::column_metadata(int column) const { switch (column) { case Column::Name: - return { 70, Gfx::TextAlignment::CenterLeft }; + return { 70 }; } ASSERT_NOT_REACHED(); } GUI::Variant IRCWindowListModel::data(const GUI::ModelIndex& index, Role role) const { + if (role == Role::TextAlignment) + return Gfx::TextAlignment::CenterLeft; if (role == Role::Display) { switch (index.column()) { case Column::Name: { |