Skip to content

Commit

Permalink
Focus settings when opening dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
guyonvarch committed Sep 8, 2023
1 parent 8df1405 commit 927acef
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kiosk/kiosk_browser/main_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@ def _show_settings(self):
additional_close_keys = [self._toggle_settings_key],
on_close = lambda: self._close_dialog()
)
self._dialog = Settings(dialog)
# Open modeless to allow accessing captive portal message banner
# https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QDialog.html#modeless-dialogs
# Focus directly to allow tabbing
dialog.show()
self._dialog = Settings(dialog)
dialog.raise_()
dialog.activateWindow()

def _show_captive_portal(self):
self._close_dialog(reload_browser_widget = False)
Expand All @@ -97,8 +100,8 @@ def _show_captive_portal(self):
additional_close_keys = [self._toggle_settings_key],
on_close = lambda: self._close_dialog()
)
dialog.show()
self._dialog = CaptivePortal(dialog)
dialog.exec_()

def _close_dialog(self, reload_browser_widget = True):
match self._dialog:
Expand Down

0 comments on commit 927acef

Please sign in to comment.