Open keyword help when pressing F1 in script editor

master
Ansariel 2023-01-27 22:01:04 +01:00
parent 291253d932
commit 74b29abfd9
3 changed files with 23 additions and 0 deletions

View File

@ -177,7 +177,9 @@ private:
bool enableAction(const std::string& action);
// NaCl End
void onBtnHelp(); // <FS:Ansariel> Keep help links
public: // <FS:Ansariel> Show keyword help on F1
void onBtnDynamicHelp();
private: // <FS:Ansariel> Show keyword help on F1
void onBtnUndoChanges();
bool hasChanged();

View File

@ -31,6 +31,8 @@
#include "llsyntaxid.h"
#include "lllocalcliprect.h"
#include "llpreviewscript.h"
// <FS:Ansariel> FIRE-23047: Increase width of line number column
//const S32 UI_TEXTEDITOR_LINE_NUMBER_MARGIN = 32;
const S32 UI_TEXTEDITOR_LINE_NUMBER_MARGIN = 40;
@ -283,3 +285,19 @@ void LLScriptEditor::startOfLine()
}
}
// </FS>
// <FS:Ansariel> Show keyword help on F1
BOOL LLScriptEditor::handleKeyHere(KEY key, MASK mask)
{
if (key == KEY_F1 && mask == MASK_NONE)
{
if (LLScriptEdCore* parent = getParentByType<LLScriptEdCore>(); parent != nullptr)
{
parent->onBtnDynamicHelp();
return TRUE;
}
}
return LLTextEditor::handleKeyHere(key, mask);
}
// </FS:Ansariel>

View File

@ -74,6 +74,9 @@ private:
// <FS:Ansariel> Doesn't exist
//void loadKeywords(const std::string& filename_keywords,
// const std::string& filename_colors);
// <FS:Ansariel> Show keyword help on F1
/*virtual*/ BOOL handleKeyHere(KEY key, MASK mask);
LLKeywords mKeywords;
bool mShowLineNumbers;