IDE, SourceEdit: Don't show hint if any mouse button is down. Issue #40117

This commit is contained in:
Martin 2024-01-14 23:17:56 +01:00
parent a7a0b3ee3a
commit 8c268c4992

View File

@ -806,6 +806,7 @@ type
function GetBaseCaption: String; override;
function GetCompletionPlugins(Index: integer): TSourceEditorCompletionPlugin; override;
function CanShowEditorHint: Boolean;
procedure EditorMouseMove(Sender: TObject; {%H-}Shift: TShiftstate;
{%H-}X,{%H-}Y: Integer);
procedure EditorMouseDown(Sender: TObject; {%H-}Button: TMouseButton;
@ -7841,6 +7842,16 @@ begin
Result := SourceEditorManager.CompletionPlugins[Index];
end;
function TSourceNotebook.CanShowEditorHint: Boolean;
begin
// Issue: 40117 Don't show hint when mouse is down
Result := (GetKeyState(VK_LBUTTON) >= 0) and
(GetKeyState(VK_RBUTTON) >= 0) and
(GetKeyState(VK_MBUTTON) >= 0) and
(GetKeyState(VK_XBUTTON1) >= 0) and
(GetKeyState(VK_XBUTTON2) >= 0);
end;
function TSourceNotebook.NewSE(Pagenum: Integer; NewPagenum: Integer;
ASharedEditor: TSourceEditor; ATabCaption: String): TSourceEditor;
begin
@ -9566,7 +9577,7 @@ procedure TSourceNotebook.EditorMouseMove(Sender: TObject; Shift: TShiftstate;
X, Y: Integer);
begin
Manager.FHints.HideAutoHintAfterMouseMoved;
if Visible then
if Visible and CanShowEditorHint then
Manager.FHints.UpdateHintTimer;
end;
@ -9676,6 +9687,8 @@ var
CurHint: String;
MLine: TSynEditMarkLine;
begin
if not CanShowEditorHint then
exit;
// hide other hints
//debugln('TSourceNotebook.ShowSynEditHint A');
Application.HideHint;
@ -11963,4 +11976,4 @@ initialization
finalization
InternalFinal;
end.
end.