mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibGUI: Add a mode where GTableModel automatically activates on selection.
This commit is contained in:
parent
84f5312dc2
commit
c1f2f5a153
Notes:
sideshowbarker
2024-07-19 15:02:36 +09:00
Author: https://github.com/awesomekling
Commit: c1f2f5a153
4 changed files with 20 additions and 1 deletions
|
|
@ -33,3 +33,14 @@ void GTableModel::did_update()
|
|||
view.did_update_model();
|
||||
});
|
||||
}
|
||||
|
||||
void GTableModel::set_selected_index(const GModelIndex& index)
|
||||
{
|
||||
if (m_selected_index == index)
|
||||
return;
|
||||
m_selected_index = index;
|
||||
if (on_selection_changed)
|
||||
on_selection_changed(index);
|
||||
if (m_activates_on_selection && is_valid(index))
|
||||
activate(index);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue