From bb76160dc1ccc3147567f323bfcf63c4ebffbe58 Mon Sep 17 00:00:00 2001 From: Christoph Hansknecht Date: Tue, 26 Mar 2024 12:19:17 +0100 Subject: [PATCH] feat: Remove underlines from quick-open targets when quick-open disabled Fixes Guake/guake#2225 --- docs/source/contributing/hacking.rst | 2 +- guake/terminal.py | 21 ++++++++++++------- .../disable-underline-8848025f0ec292d4.yaml | 2 ++ 3 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 releasenotes/notes/disable-underline-8848025f0ec292d4.yaml diff --git a/docs/source/contributing/hacking.rst b/docs/source/contributing/hacking.rst index 2186f358b..2ca9bf311 100644 --- a/docs/source/contributing/hacking.rst +++ b/docs/source/contributing/hacking.rst @@ -74,7 +74,7 @@ building the distribution packages. Same goes for the `ChangeLog` file. -Versionning +Versioning ----------- Versioning is automatically done using git tags. When a semver tag is pushed, a new version diff --git a/guake/terminal.py b/guake/terminal.py index 836e4ce2a..fd5684efb 100644 --- a/guake/terminal.py +++ b/guake/terminal.py @@ -101,7 +101,10 @@ def __init__(self, guake): super().__init__() self.guake = guake self.configure_terminal() - self.add_matches() + + if self.guake.settings.general.get_boolean("quick-open-enable"): + self.add_matches() + self.handler_ids = [] self.handler_ids.append(self.connect("button-press-event", self.button_press)) self.connect("child-exited", self.on_child_exited) # Call on_child_exited, don't remove it @@ -347,13 +350,15 @@ def button_press(self, terminal, event): handle the matched resource uri. """ self.matched_value = "" - if (Vte.MAJOR_VERSION, Vte.MINOR_VERSION) >= (0, 46): - matched_string = self.match_check_event(event) - else: - matched_string = self.match_check( - int(event.x / self.get_char_width()), - int(event.y / self.get_char_height()), - ) + + if self.guake.settings.general.get_boolean("quick-open-enable"): + if (Vte.MAJOR_VERSION, Vte.MINOR_VERSION) >= (0, 46): + matched_string = self.match_check_event(event) + else: + matched_string = self.match_check( + int(event.x / self.get_char_width()), + int(event.y / self.get_char_height()), + ) self.found_link = None diff --git a/releasenotes/notes/disable-underline-8848025f0ec292d4.yaml b/releasenotes/notes/disable-underline-8848025f0ec292d4.yaml new file mode 100644 index 000000000..cdcd048c6 --- /dev/null +++ b/releasenotes/notes/disable-underline-8848025f0ec292d4.yaml @@ -0,0 +1,2 @@ +release_summary: > + Added code to remove underlines from quick-open targets when quick-open disabled