mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 11:29:19 +02:00
Cocoa: avoid unexpected changes in the focus control during TabControl update
This commit is contained in:
parent
ab1d8281f2
commit
ac6d122b39
@ -363,7 +363,12 @@ procedure UpdateTabAndArrowVisibility(aview: TCocoaTabControl);
|
|||||||
var
|
var
|
||||||
showNext : Boolean;
|
showNext : Boolean;
|
||||||
showPrev : Boolean;
|
showPrev : Boolean;
|
||||||
|
responder: NSResponder;
|
||||||
begin
|
begin
|
||||||
|
responder:= nil;
|
||||||
|
if Assigned(aview.window) then
|
||||||
|
responder:= aview.window.firstResponder;
|
||||||
|
|
||||||
ReviseTabs(aview, showPrev, showNExt);
|
ReviseTabs(aview, showPrev, showNExt);
|
||||||
aview.updateVariousIndex;
|
aview.updateVariousIndex;
|
||||||
if Assigned(aview.prevarr) then
|
if Assigned(aview.prevarr) then
|
||||||
@ -384,6 +389,11 @@ begin
|
|||||||
aview.nextarr.setHidden(not showNext);
|
aview.nextarr.setHidden(not showNext);
|
||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if Assigned(aview.window) then begin
|
||||||
|
if Assigned(responder) and (responder<>aview.window.firstResponder) then
|
||||||
|
aview.window.makeFirstResponder(responder);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function IndexOfTab(ahost: TCocoaTabControl; atab: NSTabViewItem): Integer;
|
function IndexOfTab(ahost: TCocoaTabControl; atab: NSTabViewItem): Integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user