diff --git a/terminatorlib/config.py b/terminatorlib/config.py index 35d05e2b..a4c08a2f 100644 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -125,6 +125,7 @@ DEFAULTS = { 'line_height' : 1.0, 'case_sensitive' : True, 'invert_search' : False, + 'link_single_click' : False, }, 'keybindings': { 'zoom_in' : 'plus', diff --git a/terminatorlib/preferences.glade b/terminatorlib/preferences.glade index 62c9ddaf..fd740c7b 100644 --- a/terminatorlib/preferences.glade +++ b/terminatorlib/preferences.glade @@ -1,5 +1,5 @@ - + @@ -345,20 +345,20 @@ 1 - 0.1 - 0.2 + 0.10000000000000001 + 0.20000000000000001 1 2 1 - 0.1 - 0.2 + 0.10000000000000001 + 0.20000000000000001 1 - 0.1 - 0.2 + 0.10000000000000001 + 0.20000000000000001 False @@ -366,6 +366,9 @@ Terminator Preferences 640 400 + + + True @@ -700,7 +703,7 @@ 0 - 5 + 6 3 @@ -747,7 +750,7 @@ 0 - 6 + 7 4 @@ -801,6 +804,21 @@ 2 + + + Open links with a single click (instead of Ctrl-left click) + True + True + False + True + + + + 0 + 5 + 4 + + @@ -3256,7 +3274,7 @@ True True 0 - 0.00000000745058015283 + 7.4505801528346183e-09 0 @@ -4106,9 +4124,6 @@ Much of the behavior of Terminator is based on GNOME Terminal, and we are adding - - - @@ -4141,7 +4156,7 @@ Much of the behavior of Terminator is based on GNOME Terminal, and we are adding 1 - 0.1 + 0.10000000000000001 0.01 diff --git a/terminatorlib/prefseditor.py b/terminatorlib/prefseditor.py index 5d43953f..74e08164 100755 --- a/terminatorlib/prefseditor.py +++ b/terminatorlib/prefseditor.py @@ -24,7 +24,7 @@ def get_color_string(widcol): def color2hex(widget): """Pull the colour values out of a Gtk ColorPicker widget and return them - as 8bit hex values, sinces its default behaviour is to give 16bit values""" + as 8bit hex values, sinces its default behaviour is to give 16bit values""" return get_color_string(widget.get_color()) def rgba2hex(widget): @@ -619,6 +619,9 @@ class PrefsEditor: widget.set_value(float(self.config['inactive_color_offset'])) widget = guiget('inactive_color_offset_value_label') widget.set_text('%d%%' % (int(float(self.config['inactive_color_offset'])*100))) + # Open links with a single click (instead of a Ctrl-left click) + widget = guiget('link_single_click') + widget.set_active(self.config['link_single_click']) # Use custom URL handler widget = guiget('use_custom_url_handler_checkbox') widget.set_active(self.config['use_custom_url_handler']) @@ -1419,6 +1422,13 @@ class PrefsEditor: selection.select_iter(model.get_iter_first()) self.config.save() + def on_link_single_click_toggled(self, checkbox): + """Configure link_single_click option from checkbox.""" + guiget = self.builder.get_object + widget = guiget('link_single_click') + self.config['link_single_click'] = widget.get_active() + self.config.save() + def on_use_custom_url_handler_checkbutton_toggled(self, checkbox): """Toggling the use_custom_url_handler checkbox needs to alter the sensitivity of the custom_url_handler entrybox""" diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 2dc64791..5e743693 100644 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -950,7 +950,7 @@ class Terminal(Gtk.VBox): # Ctrl-click event here. if event.button == self.MOUSEBUTTON_LEFT: # Ctrl+leftclick on a URL should open it - if event.get_state() & Gdk.ModifierType.CONTROL_MASK == Gdk.ModifierType.CONTROL_MASK: + if self.config["link_single_click"] or event.get_state() & Gdk.ModifierType.CONTROL_MASK == Gdk.ModifierType.CONTROL_MASK: # Check new OSC-8 method first url = self.vte.hyperlink_check_event(event) dbg('url: %s' % url)