improve help implementation

This commit is contained in:
Geoffray Levasseur committed 2026-11-07 13:25:21 +01:00
1 parent 2dcc63875d
commit 9ef24e3a9e
10 files changed
+52 -26

No files matched your search

+4 -3
View File
@@ -353,11 +353,12 @@ void EnhanceDlg::resizeEvent(QResizeEvent *event)
void EnhanceDlg::keyPressEvent(QKeyEvent *event)
{
const QKeySequence pressed(event->key() | event->modifiers());
if (KeyBindings::bHelp && pressed.matches(KeyBindings::bHelp->shortCut) == QKeySequence::ExactMatch)
if (KeyBindings::bHelp && pressed.matches(KeyBindings::bHelp->shortCut) == QKeySequence::ExactMatch) {
// TODO: needs a live HelpDlg instance's textIndex() (Term.pas's
// MainScreen.HelpDlg isn't ported yet) - placeholder text index.
Help::showNewContent(windowModeMakePersistent(windowMode()), Help::LinkCategory::Text, 0);
else
if (auto *dlg = Term::mainScreenHelpDlg())
dlg->showNewContent(windowModeMakePersistent(windowMode()), Help::LinkCategory::Text, 0);
} else
FramedDlg::keyPressEvent(event);
}