Преглед изворни кода

FIX: Cocoa: FileViewNotebook will fall into chaos, caused by popup menu after DblClick on tabs (#477)

rich2014 пре 3 година
родитељ
комит
15d5af3910
1 измењених фајлова са 18 додато и 0 уклоњено
  1. 18 0
      src/ufileviewnotebook.pas

+ 18 - 0
src/ufileviewnotebook.pas

@@ -111,6 +111,7 @@ type
     FNotebookSide: TFilePanelSelect;
     FNotebookSide: TFilePanelSelect;
     FStartDrag: Boolean;
     FStartDrag: Boolean;
     FDraggedPageIndex: Integer;
     FDraggedPageIndex: Integer;
+    FTabDblClicked: Boolean;
     FHintPageIndex: Integer;
     FHintPageIndex: Integer;
     FLastMouseDownTime: TDateTime;
     FLastMouseDownTime: TDateTime;
     FLastMouseDownPageIndex: Integer;
     FLastMouseDownPageIndex: Integer;
@@ -614,10 +615,18 @@ begin
           ArrowWidth:= arrow_spacing + scroll_arrow_hlength;
           ArrowWidth:= arrow_spacing + scroll_arrow_hlength;
           if (X > ArrowWidth) and (X < ClientWidth - ArrowWidth) then
           if (X > ArrowWidth) and (X < ClientWidth - ArrowWidth) then
           {$ENDIF}
           {$ENDIF}
+
+          {$IFNDEF LCLCOCOA}
           OnDblClick(Self);
           OnDblClick(Self);
           FStartDrag:= False;
           FStartDrag:= False;
           FLastMouseDownTime:= 0;
           FLastMouseDownTime:= 0;
           FLastMouseDownPageIndex:= -1;
           FLastMouseDownPageIndex:= -1;
+          {$ELSE}
+          FStartDrag:= False;
+          FLastMouseDownTime:= 0;
+          FTabDblClicked := true;
+          {$ENDIF}
+
         end;
         end;
     end;
     end;
 end;
 end;
@@ -651,6 +660,15 @@ end;
 
 
 procedure TFileViewNotebook.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
 procedure TFileViewNotebook.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
 begin
 begin
+{$IFDEF LCLCOCOA}
+  if FTabDblClicked then
+  begin
+    OnDblClick(Self);
+    FLastMouseDownPageIndex:= -1;
+    FTabDblClicked := false;
+  end;
+{$ENDIF}
+
   inherited;
   inherited;
 
 
   FStartDrag := False;
   FStartDrag := False;