forked from qt-creator/qt-creator
F1+F1 behavior was broken if there was no context help found.
If on F1 no documentation was found, the focus was not set to the side bar, making it impossible to press F1 again to get into help mode. The fix also makes sure that the "blank" page is not set to the help mode in this case, to avoid a big white empty area.
This commit is contained in:
@@ -655,12 +655,16 @@ void HelpPlugin::activateHelpMode()
|
||||
|
||||
void HelpPlugin::switchToHelpMode()
|
||||
{
|
||||
switchToHelpMode(m_helpViewerForSideBar->source());
|
||||
QUrl source = m_helpViewerForSideBar->source();
|
||||
if (source == QUrl(Help::Constants::AboutBlank))
|
||||
source = QUrl();
|
||||
switchToHelpMode(source);
|
||||
}
|
||||
|
||||
void HelpPlugin::switchToHelpMode(const QUrl &source)
|
||||
{
|
||||
activateHelpMode();
|
||||
if (!source.isEmpty())
|
||||
m_centralWidget->setSource(source);
|
||||
m_centralWidget->setFocus();
|
||||
}
|
||||
@@ -877,6 +881,7 @@ void HelpPlugin::activateContext()
|
||||
viewer->setHtml(tr("<html><head><title>No Documentation</title>"
|
||||
"</head><body><br/><center><b>%1</b><br/>No documentation "
|
||||
"available.</center></body></html>").arg(m_idFromContext));
|
||||
viewer->setFocus(); // we still want the F1+F1 shortcut behavior
|
||||
} else {
|
||||
int version = 0;
|
||||
const QRegExp exp("(\\d+)");
|
||||
|
||||
Reference in New Issue
Block a user