aboutsummaryrefslogtreecommitdiff
path: root/src/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.py')
-rw-r--r--src/utils.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/utils.py b/src/utils.py
index 5ef3f37..2e6e90f 100644
--- a/src/utils.py
+++ b/src/utils.py
@@ -24,7 +24,7 @@ def set_margin(widget, a, b = None, c = None, d = None):
widget.set_margin_bottom(c)
widget.set_margin_start(d)
-def configure_dialog(window, parent_window, title, width=600, height=400):
+def configure_dialog(window, parent_window, title, width=600, height=400, allow_escape=True):
window.use_header_bar = True
window.set_modal(True)
window.set_transient_for(parent_window)
@@ -32,7 +32,8 @@ def configure_dialog(window, parent_window, title, width=600, height=400):
set_header_bar(window, title)
control_key = Gtk.EventControllerKey.new()
- control_key.connect('key-pressed', on_dialog_key_pressed, window)
+ if allow_escape:
+ control_key.connect('key-pressed', on_dialog_key_pressed, window)
window.add_controller(control_key)
def on_dialog_key_pressed(a, b, key, c, window):