From a36ee042e37fb5e783befe7217a07800b39e66f0 Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Sun, 8 Sep 2024 17:03:39 +0000 Subject: [PATCH 1/3] Separate button controllers - Gtk4 prep (#787) --- src/Widgets/TerminalWidget.vala | 51 +++++++++++++++++---------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/src/Widgets/TerminalWidget.vala b/src/Widgets/TerminalWidget.vala index e0a14589ff..8ed6c8fe72 100644 --- a/src/Widgets/TerminalWidget.vala +++ b/src/Widgets/TerminalWidget.vala @@ -145,7 +145,8 @@ namespace Terminal { private Gtk.EventControllerMotion motion_controller; private Gtk.EventControllerScroll scroll_controller; private Gtk.EventControllerKey key_controller; - private Gtk.GestureMultiPress press_gesture; + private Gtk.GestureMultiPress primary_gesture; + private Gtk.GestureMultiPress secondary_gesture; private bool modifier_pressed = false; private double scroll_delta = 0.0; @@ -208,12 +209,17 @@ namespace Terminal { return true; }); - press_gesture = new Gtk.GestureMultiPress (this) { + primary_gesture = new Gtk.GestureMultiPress (this) { propagation_phase = TARGET, - button = 0 + button = 1 }; - press_gesture.pressed.connect (button_pressed); - press_gesture.released.connect (button_released); + primary_gesture.pressed.connect (primary_pressed); + + secondary_gesture = new Gtk.GestureMultiPress (this) { + propagation_phase = TARGET, + button = 3 + }; + secondary_gesture.released.connect (secondary_released); // send events to key controller manually, since key_released isn't emitted in any propagation phase event.connect (key_controller.handle_event); @@ -298,33 +304,28 @@ namespace Terminal { allow_hyperlink = has_focus; } - private void button_pressed (Gtk.GestureMultiPress gesture, int n_press, double x, double y) { - link_uri = null; + private void secondary_released (Gtk.GestureMultiPress gesture, int n_press, double x, double y) { + link_uri = get_link (gesture.get_last_event (null)); - if (gesture.get_current_button () == Gdk.BUTTON_SECONDARY) { - link_uri = get_link (gesture.get_last_event (null)); - - if (link_uri != null) { - copy_action.set_enabled (true); - } + if (link_uri != null) { + copy_action.set_enabled (true); + } - popup_context_menu ({ (int) x, (int) y }); + popup_context_menu ({ (int) x, (int) y }); - gesture.set_state (CLAIMED); - } + gesture.set_state (CLAIMED); } - private void button_released (Gtk.GestureMultiPress gesture, int n_press, double x, double y) { - if (gesture.get_current_button () == Gdk.BUTTON_PRIMARY) { - if (allow_hyperlink) { - link_uri = get_link (gesture.get_last_event (null)); + private void primary_pressed (Gtk.GestureMultiPress gesture, int n_press, double x, double y) { + link_uri = null; + if (allow_hyperlink) { + link_uri = get_link (gesture.get_last_event (null)); - if (link_uri != null && !get_has_selection ()) { - main_window.get_simple_action (MainWindow.ACTION_OPEN_IN_BROWSER).activate (null); - } - } else { - allow_hyperlink = true; + if (link_uri != null && !get_has_selection ()) { + main_window.get_simple_action (MainWindow.ACTION_OPEN_IN_BROWSER).activate (null); } + } else { + allow_hyperlink = true; } } From fbcba84a306546c6163d079673de912ee7290cbe Mon Sep 17 00:00:00 2001 From: Uwe S Date: Sun, 8 Sep 2024 17:52:01 +0000 Subject: [PATCH 2/3] Translated using Weblate (German) Currently translated at 100.0% (92 of 92 strings) Translation: Terminal/Terminal Translate-URL: https://l10n.elementary.io/projects/terminal/terminal/de/ --- po/de.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/de.po b/po/de.po index dfbfba74c0..6305e5aca9 100644 --- a/po/de.po +++ b/po/de.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: pantheon-terminal\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-09-03 23:09+0000\n" -"PO-Revision-Date: 2024-08-11 18:16+0000\n" +"PO-Revision-Date: 2024-09-09 10:20+0000\n" "Last-Translator: Uwe S \n" "Language-Team: German \n" @@ -414,7 +414,7 @@ msgstr "Neu laden" #: src/Widgets/ZoomOverlay.vala:15 #, c-format msgid "Zoom: %.0f%%" -msgstr "" +msgstr "Vergrößern: %.0f%%" #~ msgid "Open a new terminal tab" #~ msgstr "Neuen Terminal-Tab öffnen" From b8d1bae5f54a2cdff17a42ddabf1615aba7d04a0 Mon Sep 17 00:00:00 2001 From: Italo Felipe Capasso Ballesteros Date: Sun, 8 Sep 2024 13:54:31 +0000 Subject: [PATCH 3/3] Translated using Weblate (Spanish) Currently translated at 100.0% (92 of 92 strings) Translation: Terminal/Terminal Translate-URL: https://l10n.elementary.io/projects/terminal/terminal/es/ --- po/es.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/es.po b/po/es.po index 113330931c..9f10000c27 100644 --- a/po/es.po +++ b/po/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: pantheon-terminal\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-09-03 23:09+0000\n" -"PO-Revision-Date: 2024-08-10 16:16+0000\n" +"PO-Revision-Date: 2024-09-09 10:20+0000\n" "Last-Translator: Italo Felipe Capasso Ballesteros \n" "Language-Team: Spanish \n" @@ -415,7 +415,7 @@ msgstr "Volver a cargar" #: src/Widgets/ZoomOverlay.vala:15 #, c-format msgid "Zoom: %.0f%%" -msgstr "" +msgstr "Escala: %.0f%%" #~ msgid "ReLoad" #~ msgstr "Recargar pestaña"