Skip to content

Commit

Permalink
feat: ctrl + plus/minus for zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
GeopJr committed Jul 21, 2023
1 parent 367a416 commit 001349f
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 @@ -346,9 +346,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 001349f

Please sign in to comment.