diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index b51cb16f68a89fc11ebbf2e4195f0f114454b76d..07301309ef7cd9af002b261c5b41a6a8900deb94 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -267,23 +267,18 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error) action = new QAction(tr("Increase Font Size"), this); cmd = am->registerAction(action, TextEditor::Constants::INCREASE_FONT_SIZE, modecontext); - cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl++"))); connect(action, SIGNAL(triggered()), m_centralWidget, SLOT(zoomIn())); advancedMenu->addAction(cmd, Core::Constants::G_EDIT_FONT); action = new QAction(tr("Decrease Font Size"), this); cmd = am->registerAction(action, TextEditor::Constants::DECREASE_FONT_SIZE, modecontext); - cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+-"))); connect(action, SIGNAL(triggered()), m_centralWidget, SLOT(zoomOut())); advancedMenu->addAction(cmd, Core::Constants::G_EDIT_FONT); action = new QAction(tr("Reset Font Size"), this); cmd = am->registerAction(action, TextEditor::Constants::RESET_FONT_SIZE, modecontext); -#ifndef Q_WS_MAC - cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+0"))); -#endif connect(action, SIGNAL(triggered()), m_centralWidget, SLOT(resetZoom())); advancedMenu->addAction(cmd, Core::Constants::G_EDIT_FONT); } @@ -305,14 +300,6 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error) windowMenu->addAction(ctrlShiftTab, Core::Constants::G_WINDOW_NAVIGATE); connect(action, SIGNAL(triggered()), &OpenPagesManager::instance(), SLOT(gotoNextPage())); - -#ifdef Q_WS_MAC - ctrlTab->setDefaultKeySequence(QKeySequence(tr("Alt+Tab"))); - ctrlShiftTab->setDefaultKeySequence(QKeySequence(tr("Alt+Shift+Tab"))); -#else - ctrlTab->setDefaultKeySequence(QKeySequence(tr("Ctrl+Tab"))); - ctrlShiftTab->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+Tab"))); -#endif } Aggregation::Aggregate *agg = new Aggregation::Aggregate; @@ -583,15 +570,16 @@ void HelpPlugin::createRightPaneContextViewer() Aggregation::Aggregate *agg = new Aggregation::Aggregate(); agg->add(m_helpViewerForSideBar); agg->add(new HelpViewerFindSupport(m_helpViewerForSideBar)); + + Core::Context context(Constants::C_HELP_SIDEBAR); m_core->addContextObject(new Core::BaseContext(m_helpViewerForSideBar, - Core::Context(Constants::C_HELP_SIDEBAR), this)); + context, this)); QAction *copy = new QAction(this); Core::Command *cmd = m_core->actionManager()->registerAction(copy, - Core::Constants::COPY, Core::Context(Constants::C_HELP_SIDEBAR)); + Core::Constants::COPY, context); copy->setText(cmd->action()->text()); copy->setIcon(cmd->action()->icon()); - connect(copy, SIGNAL(triggered()), m_helpViewerForSideBar, SLOT(copy())); next->setEnabled(m_helpViewerForSideBar->isForwardAvailable()); @@ -604,11 +592,51 @@ void HelpPlugin::createRightPaneContextViewer() connect(m_helpViewerForSideBar, SIGNAL(backwardAvailable(bool)), back, SLOT(setEnabled(bool))); + Core::ActionManager *am = m_core->actionManager(); + if (Core::ActionContainer *advancedMenu = am->actionContainer(M_EDIT_ADVANCED)) { + // reuse TextEditor constants to avoid a second pair of menu actions + QAction *action = new QAction(tr("Increase Font Size"), this); + cmd = am->registerAction(action, TextEditor::Constants::INCREASE_FONT_SIZE, + context); + connect(action, SIGNAL(triggered()), this, SLOT(scaleRightPaneUp())); + advancedMenu->addAction(cmd, Core::Constants::G_EDIT_FONT); + + action = new QAction(tr("Decrease Font Size"), this); + cmd = am->registerAction(action, TextEditor::Constants::DECREASE_FONT_SIZE, + context); + connect(action, SIGNAL(triggered()), this, SLOT(scaleRightPaneDown())); + advancedMenu->addAction(cmd, Core::Constants::G_EDIT_FONT); + + action = new QAction(tr("Reset Font Size"), this); + cmd = am->registerAction(action, TextEditor::Constants::RESET_FONT_SIZE, + context); + connect(action, SIGNAL(triggered()), this, SLOT(resetRightPaneScale())); + advancedMenu->addAction(cmd, Core::Constants::G_EDIT_FONT); + } + // force setup, as we might have never switched to full help mode // thus the help engine might still run without collection file setup m_helpManager->setupGuiHelpEngine(); } +void HelpPlugin::scaleRightPaneUp() +{ + if (m_helpViewerForSideBar) + m_helpViewerForSideBar->scaleUp(); +} + +void HelpPlugin::scaleRightPaneDown() +{ + if (m_helpViewerForSideBar) + m_helpViewerForSideBar->scaleDown(); +} + +void HelpPlugin::resetRightPaneScale() +{ + if (m_helpViewerForSideBar) + m_helpViewerForSideBar->resetScale(); +} + void HelpPlugin::activateHelpMode() { if (contextHelpOption() != Help::Constants::ExternalHelpAlways) diff --git a/src/plugins/help/helpplugin.h b/src/plugins/help/helpplugin.h index 0d387691cabb346f6b06f22623e0c5790e679ab6..ff63ecb3f44529553848a2962d0d2ebccab3d3b5 100644 --- a/src/plugins/help/helpplugin.h +++ b/src/plugins/help/helpplugin.h @@ -115,6 +115,10 @@ private slots: void openFindToolBar(); + void scaleRightPaneUp(); + void scaleRightPaneDown(); + void resetRightPaneScale(); + private: void setupUi(); void resetFilter();