Merge branch 'IDE/Help/HelpButton' into 'main'

IDE/Help: Mention in the help button hint that it will open in the browser

See merge request freepascal.org/lazarus/lazarus!537
This commit is contained in:
Juha Manninen 2025-07-14 12:42:05 +00:00
commit bd768042b8
2 changed files with 6 additions and 2 deletions

View File

@ -5013,6 +5013,7 @@ resourcestring
lisHOFPCDocHTMLPath = 'FPC Doc HTML Path';
lisHlpOptsProperties = 'Properties:';
lisHlpOptsDatabases = 'Databases';
lisOpenContextHelpInBrowser = 'Open context help in the browser';
// enclose selection dialog
lisChooseStructureToEncloseSelection = 'Choose structure to enclose selection';

View File

@ -12581,11 +12581,14 @@ begin
lHelpButton.OnClick:=@LazarusHelp.HelpButtonClick;
// set shortcut hint
if lHelpButton.Hint='' then begin
// explain the button action
lHelpButton.ShowHint:=true;
lHelpButton.Hint:=lisOpenContextHelpInBrowser;
// maybe add shortcut
lContextHelpCommand:=IDECommandList.FindIDECommand(ecContextHelp);
if Assigned(lContextHelpCommand) then begin
with lContextHelpCommand do
lHelpButton.Hint:=KeyValuesToCaptionStr(ShortcutA,ShortcutB);
lHelpButton.ShowHint:=true;
lHelpButton.Hint:=lHelpButton.Hint+' '+KeyValuesToCaptionStr(ShortcutA,ShortcutB);
end;
end;
end;