From 43fb947da02c2518e35fff12c3c22e950e744079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sat, 28 Oct 2023 02:18:29 +0200 Subject: [PATCH] ScrollArea: Adapt mouse wheel scrolling to client size. [GB.GUI.BASE] * NEW: GridView: Lighter row highlighting. * NEW: ScrollArea: Adapt mouse wheel scrolling to client size. --- comp/src/gb.gui.base/.src/GridView/GridView.class | 2 +- comp/src/gb.gui.base/.src/ScrollArea.class | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/comp/src/gb.gui.base/.src/GridView/GridView.class b/comp/src/gb.gui.base/.src/GridView/GridView.class index 01fec16dc..b6dc48138 100644 --- a/comp/src/gb.gui.base/.src/GridView/GridView.class +++ b/comp/src/gb.gui.base/.src/GridView/GridView.class @@ -835,7 +835,7 @@ Public Sub ScrollArea_Draw() NEXT_ROW: If $bHighlight And If I = $iHighlight Then - Paint.FillRect(0, Y, Paint.W, H, Color.SetAlpha(Color.SelectedBackground, 192)) + Paint.FillRect(0, Y, Paint.W, H, Color.SetAlpha(Color.SelectedBackground, 224)) Endif Y += H diff --git a/comp/src/gb.gui.base/.src/ScrollArea.class b/comp/src/gb.gui.base/.src/ScrollArea.class index 1b1a27c87..160270e0d 100644 --- a/comp/src/gb.gui.base/.src/ScrollArea.class +++ b/comp/src/gb.gui.base/.src/ScrollArea.class @@ -757,8 +757,10 @@ Public Sub DrawingArea_MouseWheel() D = Desktop.Scale * 60 If Mouse.Orientation = Mouse.Horizontal Or If $H <= $hDrawingArea.H Then + D = Min(D, ($hDrawingArea.W + 1) \ 2) Scroll($iScrollX - Mouse.Delta * D, $iScrollY) Else + D = Min(D, ($hDrawingArea.H + 1) \ 2) Scroll($iScrollX, $iScrollY - Mouse.Delta * D) Endif