[shotwell] Really use a configurable scroll factor
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell] Really use a configurable scroll factor
- Date: Sat, 8 Oct 2022 04:32:21 +0000 (UTC)
commit f8e7f8f5201e76a7075da586e5046009ff6fed54
Author: Jens Georg <mail jensge org>
Date: Sat Oct 8 06:32:00 2022 +0200
Really use a configurable scroll factor
src/Page.vala | 11 +++++++----
src/SinglePhotoPage.vala | 1 +
2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/Page.vala b/src/Page.vala
index d21cfa33..0df56416 100644
--- a/src/Page.vala
+++ b/src/Page.vala
@@ -85,6 +85,9 @@ public abstract class Page : Gtk.ScrolledWindow {
private int cursor_hide_time_cached = 0;
private bool are_actions_attached = false;
private OneShotScheduler? update_actions_scheduler = null;
+
+ protected double wheel_factor = 0.0;
+ protected double modified_wheel_factor = 1.0;
protected Page(string page_name) {
this.page_name = page_name;
@@ -989,13 +992,13 @@ public abstract class Page : Gtk.ScrolledWindow {
double dx, dy;
event.get_scroll_deltas(out dx, out dy);
- if (dy < 0)
+ if (dy < -1.0 * this.wheel_factor)
return on_mousewheel_up(event);
- else if (dy > 0)
+ else if (dy > this.wheel_factor)
return on_mousewheel_down(event);
- else if (dx < 0)
+ else if (dx < -1.0 * this.wheel_factor)
return on_mousewheel_left(event);
- else if (dx > 0)
+ else if (dx > this.wheel_factor)
return on_mousewheel_right(event);
else
return false;
diff --git a/src/SinglePhotoPage.vala b/src/SinglePhotoPage.vala
index d87b891c..d186318f 100644
--- a/src/SinglePhotoPage.vala
+++ b/src/SinglePhotoPage.vala
@@ -38,6 +38,7 @@ public abstract class SinglePhotoPage : Page {
protected SinglePhotoPage(string page_name, bool scale_up_to_viewport) {
base(page_name);
+ this.wheel_factor = 0.9999;
this.scale_up_to_viewport = scale_up_to_viewport;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]