Ver Fonte

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

Co-authored-by: rich <[email protected]>
rich2014 há 3 anos atrás
pai
commit
a0ce8876f8
2 ficheiros alterados com 13 adições e 0 exclusões
  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;
     end;
     inherited SetFocus;
     inherited SetFocus;
     MainControl.SetFocus;
     MainControl.SetFocus;
+    {$IFDEF LCLCOCOA}
+    Active := true;
+    {$ENDIF}
   end;
   end;
 end;
 end;
 
 

+ 10 - 0
src/fmain.pas

@@ -2515,7 +2515,17 @@ end;
 
 
 procedure TfrmMain.nbPageMouseDown(Sender: TObject; Button: TMouseButton;
 procedure TfrmMain.nbPageMouseDown(Sender: TObject; Button: TMouseButton;
   Shift: TShiftState; X, Y: Integer);
   Shift: TShiftState; X, Y: Integer);
+{$IFNDEF LCLCOCOA}
 begin
 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));
   Application.QueueAsyncCall(@nbPageAfterMouseDown, PtrInt(Sender));
 end;
 end;