LibGUI: GTableView should clear the selection if clicking outside items.

This commit is contained in:
Andreas Kling 2019-02-28 14:05:02 +01:00
parent 6af2ce0f7e
commit 62b4f39cd4
Notes: sideshowbarker 2024-07-19 15:35:41 +09:00
2 changed files with 11 additions and 4 deletions

View file

@ -66,6 +66,10 @@ GModelIndex ProcessTableModel::selected_index() const
void ProcessTableModel::set_selected_index(GModelIndex index)
{
if (!index.is_valid()) {
m_selected_row = -1;
return;
}
if (index.row() >= 0 && index.row() < m_pids.size())
m_selected_row = index.row();
}