From 4e58da1aacb709d84ad4160d53ab35c459b33b90 Mon Sep 17 00:00:00 2001 From: Mitchell Foral Date: Wed, 23 Mar 2022 09:01:56 +1100 Subject: On GTK, scroll horizontally with shift + scroll wheel. --- doc/ScintillaHistory.html | 3 +++ gtk/ScintillaGTK.cxx | 11 ++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 544fcd11f..7432aee44 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -585,6 +585,9 @@ Feature #1431.
  • + On GTK, scroll horizontally with shift + scroll wheel. +
  • +
  • Fix crash with unexpected right-to-left text on GTK. Bug #2309.
  • diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index dd22dcbc9..a1ac3adf8 100755 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -1999,11 +1999,6 @@ gint ScintillaGTK::ScrollEvent(GtkWidget *widget, GdkEventScroll *event) { // issues spurious button 2 mouse events during wheeling, which can cause // problems (a patch for both was submitted by archaeopteryx.com on 13Jun2001) - // Data zoom not supported - if (event->state & GDK_SHIFT_MASK) { - return FALSE; - } - #if GTK_CHECK_VERSION(3,4,0) // Smooth scrolling not supported if (event->direction == GDK_SCROLL_SMOOTH) { @@ -2012,8 +2007,10 @@ gint ScintillaGTK::ScrollEvent(GtkWidget *widget, GdkEventScroll *event) { #endif // Horizontal scrolling - if (event->direction == GDK_SCROLL_LEFT || event->direction == GDK_SCROLL_RIGHT) { - sciThis->HorizontalScrollTo(sciThis->xOffset + cLineScroll); + if (event->direction == GDK_SCROLL_LEFT || event->direction == GDK_SCROLL_RIGHT || event->state & GDK_SHIFT_MASK) { + int hScroll = gtk_adjustment_get_step_increment(sciThis->adjustmenth); + hScroll *= cLineScroll; // scroll by this many characters + sciThis->HorizontalScrollTo(sciThis->xOffset + hScroll); // Text font size zoom } else if (event->state & GDK_CONTROL_MASK) { -- cgit v1.2.3