Skip to content

Commit 7ccfe22

Browse files
committed
try make it build
1 parent b01315a commit 7ccfe22

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Services/ZoomController.vala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ public class Jorts.ZoomController : Object {
3535
var keypress_controller = new Gtk.EventControllerKey ();
3636
keypress_controller.key_pressed.connect (on_key_press_event);
3737
keypress_controller.key_released.connect (on_key_release_event);
38-
keypress_controller.widget = window;
38+
window.add_controller ((Gtk.EventController)keypress_controller);
3939

4040
var scroll_controller = new Gtk.EventControllerScroll (VERTICAL);
4141
scroll_controller.scroll_end.connect (() => current_scroll_delta = 0);
4242
scroll_controller.scroll.connect ((dx, dy) => on_scroll);
43-
scroll_controller.widget = window;
43+
window.add_controller ((Gtk.EventController)scroll_controller);
4444
}
4545

4646
/**
@@ -123,8 +123,8 @@ public class Jorts.ZoomController : Object {
123123
}
124124
}
125125

126-
private void on_scroll (double dx, double dy) {
127-
if (!is_control_key_pressed) { return;}
126+
private bool on_scroll (double dx, double dy) {
127+
if (!is_control_key_pressed) { return false;}
128128

129129
if (current_scroll_delta == 0) {
130130
zoom_changed (Zoomkind.from_delta (dy));
@@ -135,5 +135,7 @@ public class Jorts.ZoomController : Object {
135135
if (current_scroll_delta.abs () > sensitivity) { // Balance between reactive and ignoring misinput
136136
current_scroll_delta = 0;
137137
}
138+
139+
return true;
138140
}
139141
}

0 commit comments

Comments
 (0)