From ad1c9fee04db3a3b920a673d264e66089b62131d Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Mon, 18 Mar 2013 17:35:00 -0700 Subject: [PATCH] gtk-screen: Customize scrollbar behavior. Specialize the internal fix-layout-adjustment-parameters generic. --- src/gtk-screen/gtk-screen.pkg | 1 + src/gtk-screen/gtk-screen.scm | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/gtk-screen/gtk-screen.pkg b/src/gtk-screen/gtk-screen.pkg index ff999951b..e41a6a5fb 100644 --- a/src/gtk-screen/gtk-screen.pkg +++ b/src/gtk-screen/gtk-screen.pkg @@ -89,6 +89,7 @@ USA. gtk-paned-view-init) (import (gtk fix-layout) fix-widget-geometry + fix-layout-adjustment-parameters drawing-damage fix-drawing-display-list diff --git a/src/gtk-screen/gtk-screen.scm b/src/gtk-screen/gtk-screen.scm index 560e60bb3..6e7787e03 100644 --- a/src/gtk-screen/gtk-screen.scm +++ b/src/gtk-screen/gtk-screen.scm @@ -1214,6 +1214,23 @@ USA. (define-integrable (editor-frame? object) (object-of-class? editor-frame object)) +(define-method fix-layout-adjustment-parameters ((widget ) + view-size extent-size + extent-low receiver) + (declare (ignore widget)) + (if (fix:< view-size extent-size) + ;; Drawing is larger than viewport: thumb (page) is viewport. + (begin + (%trace "; large-drawing:"extent-size" view:"view-size"\n") + (receiver extent-low view-size)) + ;; Viewport is larger than drawing: thumb (page) is 0. + (begin + (%trace "; drawing:"extent-size" large-view:"view-size"\n") + ;; When page-size = extent-size, high will be extent-low [see + ;; adjust-adjustment]. Thus high and low are extent-low, and + ;; value will be clamped to extent-low. + (receiver extent-low extent-size)))) + (define-class ( (constructor make-modeline-widget (screen))) ()) -- 2.25.1