mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 18:59:21 +02:00
Cocoa/TabControl: add triggeringByLCL to distinguish whether the operation is triggered by User or Program
This commit is contained in:
parent
82d467b50c
commit
cbb27a8f6d
@ -58,6 +58,8 @@ type
|
||||
nextarr : NSButton;
|
||||
|
||||
public
|
||||
triggeringByLCL: Boolean;
|
||||
|
||||
{ various indexes in fulltabs }
|
||||
currentIndex : Integer; // index of the current tab
|
||||
visibleLeftIndex: Integer; // index shown in TabView on the left
|
||||
@ -633,6 +635,9 @@ procedure TCocoaTabControl.tabView_didSelectTabViewItem(tabView: NSTabView;
|
||||
begin
|
||||
//it's called together with "willSelect"
|
||||
|
||||
if triggeringByLCL then
|
||||
exit;
|
||||
|
||||
currentIndex:= IndexOfTab( self, tabViewItem );
|
||||
leftKeepAmount:= currentIndex - visibleLeftIndex;
|
||||
|
||||
@ -858,6 +863,8 @@ var
|
||||
nextTabPage: NSTabViewItem;
|
||||
prevTabPage: NSTabViewItem;
|
||||
begin
|
||||
triggeringByLCL:= true;
|
||||
try
|
||||
removedIndex := exttabIndexOfTabViewItem( removedTabPage );
|
||||
isRemovingCurrentPage:= (removedIndex=currentIndex);
|
||||
|
||||
@ -913,6 +920,9 @@ begin
|
||||
end;
|
||||
|
||||
UpdateTabAndArrowVisibility( self );
|
||||
finally
|
||||
triggeringByLCL:= false;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCocoaTabControl.exttabIndexOfTabViewItem(lTabPage: NSTabViewItem
|
||||
|
Loading…
Reference in New Issue
Block a user