Skip to content

Commit

Permalink
feat(MediaViewer): ctrl +/- for zooming (#398)
Browse files Browse the repository at this point in the history
* revert: "feat(MediaViewer): do not use osd (#376)"

This reverts commit 78337c2.

* feat: remove zoom buttons

* feat: ctrl + plus/minus for zoom

* revert: "feat: remove zoom buttons"

This reverts commit 367a416.
  • Loading branch information
GeopJr authored Sep 18, 2023
1 parent 94d763e commit 5682878
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/Views/MediaViewer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,22 @@ public class Tuba.Views.MediaViewer : Gtk.Box {
}

protected bool on_keypress (uint keyval, uint keycode, Gdk.ModifierType state) {
// Don't handle it if there's
// a modifier
if (state != 0) return false;
if (state != 0) {
if (state != Gdk.ModifierType.CONTROL_MASK) return false;

switch (keyval) {
case Gdk.Key.equal:
safe_get ((int) carousel.position)?.zoom_in ();
break;
case Gdk.Key.minus:
safe_get ((int) carousel.position)?.zoom_out ();
break;
default:
return false;
}

return true;
}

switch (keyval) {
case Gdk.Key.Left:
Expand Down

0 comments on commit 5682878

Please sign in to comment.