mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-06 11:12:54 +00:00
LibGUI: Convert various little things to GModelSelection
All the little things that were using the per-model seletion are now moving over to GModelSelection.
This commit is contained in:
parent
d2d1a30d61
commit
fb18613e8a
Notes:
sideshowbarker
2024-07-19 12:13:28 +09:00
Author: https://github.com/awesomekling
Commit: fb18613e8a
3 changed files with 6 additions and 9 deletions
|
@ -31,16 +31,16 @@ void GAbstractView::set_model(RefPtr<GModel>&& model)
|
|||
|
||||
void GAbstractView::did_update_model()
|
||||
{
|
||||
if (!model() || model()->selected_index() != m_edit_index)
|
||||
if (!model() || selection().first() != m_edit_index)
|
||||
stop_editing();
|
||||
}
|
||||
|
||||
void GAbstractView::did_update_selection()
|
||||
{
|
||||
if (!model() || model()->selected_index() != m_edit_index)
|
||||
if (!model() || selection().first() != m_edit_index)
|
||||
stop_editing();
|
||||
if (model() && on_selection && model()->selected_index().is_valid())
|
||||
on_selection(model()->selected_index());
|
||||
if (model() && on_selection && selection().first().is_valid())
|
||||
on_selection(selection().first());
|
||||
}
|
||||
|
||||
void GAbstractView::did_scroll()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue