mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
LibGUI: Make descendants of AbstractView define their own select_all() (#1201)
AbstractView does not know which column it's displaying which makes it impossible to implement the select_all functionality up there. Now descendants override the pure virtual select_all method and implement it themselves.
This commit is contained in:
@@ -43,6 +43,15 @@ ListView::~ListView()
|
||||
{
|
||||
}
|
||||
|
||||
void ListView::select_all()
|
||||
{
|
||||
selection().clear();
|
||||
for (int item_index = 0; item_index < item_count(); ++item_index) {
|
||||
auto index = model()->index(item_index, m_model_column);
|
||||
selection().add(index);
|
||||
}
|
||||
}
|
||||
|
||||
void ListView::update_content_size()
|
||||
{
|
||||
if (!model())
|
||||
|
||||
Reference in New Issue
Block a user