aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMitchell Foral <unknown>2022-03-23 09:01:56 +1100
committerMitchell Foral <unknown>2022-03-23 09:01:56 +1100
commit4e58da1aacb709d84ad4160d53ab35c459b33b90 (patch)
tree3fefdb74d722e3a99c0e09d56a0f2ed936284bd3
parent23b2a54292964dc653d7ebb64c4b2a044eeaa8e7 (diff)
downloadscintilla-mirror-4e58da1aacb709d84ad4160d53ab35c459b33b90.tar.gz
On GTK, scroll horizontally with shift + scroll wheel.
-rw-r--r--doc/ScintillaHistory.html3
-rwxr-xr-xgtk/ScintillaGTK.cxx11
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 @@
<a href="https://sourceforge.net/p/scintilla/feature-requests/1431/">Feature #1431</a>.
</li>
<li>
+ On GTK, scroll horizontally with shift + scroll wheel.
+ </li>
+ <li>
Fix crash with unexpected right-to-left text on GTK.
<a href="https://sourceforge.net/p/scintilla/bugs/2309/">Bug #2309</a>.
</li>
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) {