aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk
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 /gtk
parent23b2a54292964dc653d7ebb64c4b2a044eeaa8e7 (diff)
downloadscintilla-mirror-4e58da1aacb709d84ad4160d53ab35c459b33b90.tar.gz
On GTK, scroll horizontally with shift + scroll wheel.
Diffstat (limited to 'gtk')
-rwxr-xr-xgtk/ScintillaGTK.cxx11
1 files changed, 4 insertions, 7 deletions
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) {