Forráskód Böngészése

LibGUI: Allow AbstractView::set_cursor(ModelIndex(), ...)

This should be a valid way to clear the cursor.
Andreas Kling 5 éve
szülő
commit
734035857e
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      Libraries/LibGUI/AbstractView.cpp

+ 1 - 1
Libraries/LibGUI/AbstractView.cpp

@@ -428,7 +428,7 @@ void AbstractView::set_cursor(ModelIndex index, SelectionUpdate selection_update
     if (m_cursor_index == index)
         return;
 
-    if (!model()) {
+    if (!model() || !index.is_valid()) {
         m_cursor_index = {};
         return;
     }