Browse Source

UPD: Cocoa: switch panel and tab more like on windows(when mouse down) (#467)

Co-authored-by: rich <[email protected]>
rich2014 3 years ago
parent
commit
a0ce8876f8
2 changed files with 13 additions and 0 deletions
  1. 3 0
      src/fileviews/ufileviewwithmainctrl.pas
  2. 10 0
      src/fmain.pas

+ 3 - 0
src/fileviews/ufileviewwithmainctrl.pas

@@ -1231,6 +1231,9 @@ begin
     end;
     inherited SetFocus;
     MainControl.SetFocus;
+    {$IFDEF LCLCOCOA}
+    Active := true;
+    {$ENDIF}
   end;
 end;
 

+ 10 - 0
src/fmain.pas

@@ -2515,7 +2515,17 @@ end;
 
 procedure TfrmMain.nbPageMouseDown(Sender: TObject; Button: TMouseButton;
   Shift: TShiftState; X, Y: Integer);
+{$IFNDEF LCLCOCOA}
 begin
+{$ELSE}
+var
+  Notebook: TFileViewNotebook;
+  TabNr: Integer;
+begin
+  Notebook := TFileViewNotebook(Sender);
+  TabNr := Notebook.IndexOfPageAt(Point(X, Y));
+  if TabNr <> -1 then Notebook.ActivePageIndex := TabNr;
+{$ENDIF}
   Application.QueueAsyncCall(@nbPageAfterMouseDown, PtrInt(Sender));
 end;