Skip to content

Commit

Permalink
Always reselect 'new map' option when changing workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 21, 2023
1 parent b20b6d5 commit cea133b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion felt/gui/recent_maps_list_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,11 @@ def set_workspace_id(self, workspace_id: Optional[str]):
Sets the selected workspace ID to filter the view
"""
self._model.set_workspace_id(workspace_id)
# when you change the workspace the new map
# option should get selected again
self.selectionModel().select(
self._model.index(0, 0),
QItemSelectionModel.ClearAndSelect)

def set_new_map_title(self, title: str):
"""
Expand All @@ -301,7 +306,7 @@ def _on_first_results_found(self):

# while you search, the first search result should be
# selected so you can quickly hit enter
if self._model.filter_string() or self._model.workspace_id():
if self._model.filter_string():
self.selectionModel().select(
self._model.index(1, 0),
QItemSelectionModel.ClearAndSelect)
Expand Down

0 comments on commit cea133b

Please sign in to comment.