View Issue Details

IDProjectCategoryView StatusLast Update
0031897PatchesLCLpublic2017-06-07 13:56
ReporterCudaText man Assigned ToMattias Gaertner  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version1.9 (SVN) 
Summary0031897: Treeview horz scroll by trackpad on Mac
DescriptionThis is small diff which uses ssHyper shift state to adapt to horz scroll on Mac.
W/o it Tree cannot scroll horz by trackpad.
Tested on real Mac.

ps. Listview don't need this patch, it works already.
TagsNo tags attached.
Fixed in Revision55264
LazTarget-
Widgetset
Attached Files

Activities

CudaText man

2017-05-23 13:58

reporter  

treemac.diff (877 bytes)   
diff --git a/lcl/include/treeview.inc b/lcl/include/treeview.inc
index 04c77c9..6b41ba2 100644
--- a/lcl/include/treeview.inc
+++ b/lcl/include/treeview.inc
@@ -4655,12 +4655,18 @@ end;
 
 function TCustomTreeView.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer;
   MousePos: TPoint): Boolean;
+var
+  NDelta: integer;
 begin
   Result:=inherited DoMouseWheel(Shift, WheelDelta, MousePos);
   if not Result then
   begin
-    ScrolledTop := ScrolledTop -
-              (WheelDelta * Mouse.WheelScrollLines * DefaultItemHeight) div 120;
+    NDelta := (WheelDelta * Mouse.WheelScrollLines * DefaultItemHeight) div 120;
+    // Mac widgetset sets ssHyper on horz scrolling
+    if ssHyper in Shift then
+      ScrolledLeft := ScrolledLeft - NDelta
+    else
+      ScrolledTop := ScrolledTop - NDelta;
     Result := true;
   end;
   UpdateTooltip(MousePos.X, MousePos.Y);
treemac.diff (877 bytes)   

Issue History

Date Modified Username Field Change
2017-05-23 13:58 CudaText man New Issue
2017-05-23 13:58 CudaText man File Added: treemac.diff
2017-06-07 13:56 Mattias Gaertner Fixed in Revision => 55264
2017-06-07 13:56 Mattias Gaertner LazTarget => -
2017-06-07 13:56 Mattias Gaertner Status new => resolved
2017-06-07 13:56 Mattias Gaertner Resolution open => fixed
2017-06-07 13:56 Mattias Gaertner Assigned To => Mattias Gaertner