Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit committed Sep 10, 2024
2 parents cebd5ef + b8d1bae commit 126ef08
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 29 deletions.
4 changes: 2 additions & 2 deletions po/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>\n"
"Language-Team: German <https://l10n.elementary.io/projects/terminal/terminal/"
"de/>\n"
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions po/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>\n"
"Language-Team: Spanish <https://l10n.elementary.io/projects/terminal/"
"terminal/es/>\n"
Expand Down Expand Up @@ -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"
Expand Down
52 changes: 27 additions & 25 deletions src/Widgets/TerminalWidget.vala
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ 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 control_pressed = false;
private bool shift_pressed = false;
private double scroll_delta = 0.0;
Expand Down Expand Up @@ -197,12 +199,17 @@ namespace Terminal {
key_controller.key_released.connect (key_released);
key_controller.focus_out.connect (() => scroll_controller.flags = NONE);

press_gesture = new Gtk.GestureMultiPress (this) {
primary_gesture = new Gtk.GestureMultiPress (this) {
propagation_phase = TARGET,
button = 1
};
primary_gesture.pressed.connect (primary_pressed);

secondary_gesture = new Gtk.GestureMultiPress (this) {
propagation_phase = TARGET,
button = 0
button = 3
};
press_gesture.pressed.connect (button_pressed);
press_gesture.released.connect (button_released);
secondary_gesture.released.connect (secondary_released);

// Send events to key controller manually, since key_released isn't emitted in any propagation phase
// This is not needed in Gtk4 as key_released is emitted.
Expand Down Expand Up @@ -288,33 +295,28 @@ namespace Terminal {
allow_hyperlink = has_focus;
}

private void button_pressed (Gtk.GestureMultiPress gesture, int n_press, double x, double y) {
link_uri = null;

if (gesture.get_current_button () == Gdk.BUTTON_SECONDARY) {
link_uri = get_link (gesture.get_last_event (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 (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;
}
}

Expand Down

0 comments on commit 126ef08

Please sign in to comment.