Commit 65d30235 authored by Marinus Schraal's avatar Marinus Schraal

window: Do not allow view switching in all modes

Keyboard shortcuts allowed view switching in selection and child modes.
This could leave the ui in an undefined state.
Disable view switching in these cases.
parent bdeaed0f
......@@ -422,7 +422,14 @@ class Window(Gtk.ApplicationWindow):
def _toggle_view(self, view_enum):
# TODO: The SEARCH state actually refers to the child state of
# the search mode. This fixes the behaviour as needed, but is
# incorrect: searchview currently does not switch states
# correctly.
if (not self.headerbar.props.selection_mode
and not self.headerbar.props.state == HeaderBar.State.CHILD
and not self.headerbar.props.state == HeaderBar.State.SEARCH):
def _on_search_toggled(self, button, data=None):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment