mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
GModelSelection: Add contains_row(int) and toggle(GModelIndex)
This commit is contained in:
@@ -20,6 +20,16 @@ void GModelSelection::add(const GModelIndex& index)
|
||||
m_view.notify_selection_changed({});
|
||||
}
|
||||
|
||||
void GModelSelection::toggle(const GModelIndex& index)
|
||||
{
|
||||
ASSERT(index.is_valid());
|
||||
if (m_indexes.contains(index))
|
||||
m_indexes.remove(index);
|
||||
else
|
||||
m_indexes.set(index);
|
||||
m_view.notify_selection_changed({});
|
||||
}
|
||||
|
||||
bool GModelSelection::remove(const GModelIndex& index)
|
||||
{
|
||||
ASSERT(index.is_valid());
|
||||
|
||||
Reference in New Issue
Block a user