From cc2c385b80230d56f6003f08939b127646cec4dc Mon Sep 17 00:00:00 2001 From: kh <qtc-committer@nokia.com> Date: Tue, 23 Jun 2009 16:57:03 +0200 Subject: [PATCH] Make the documentation font resizable by shortcut. Task-number: 253365 Reviewed-by: dt --- src/plugins/help/helpplugin.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 140e3ff5ea9..0256309436f 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -52,6 +52,8 @@ #include <coreplugin/sidebar.h> #include <coreplugin/welcomemode.h> +#include <texteditor/texteditorconstants.h> + #include <QtCore/QDebug> #include <QtCore/qplugin.h> #include <QtCore/QFileInfo> @@ -386,6 +388,24 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error) QDesktopServices::setUrlHandler("qthelp", this, "openHelpPage"); + if (Core::ActionContainer *advancedMenu = + am->actionContainer(Core::Constants::M_EDIT_ADVANCED)) { + // reuse TextEditor constants to avoid a second pair of menu actions + QAction *a = new QAction(tr("Increase Font Size"), this); + cmd = am->registerAction(a, TextEditor::Constants::INCREASE_FONT_SIZE, + modecontext); + cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl++"))); + connect(a, SIGNAL(triggered()), m_centralWidget, SLOT(zoomIn())); + advancedMenu->addAction(cmd, Core::Constants::G_EDIT_FONT); + + a = new QAction(tr("Decrease Font Size"), this); + cmd = am->registerAction(a, TextEditor::Constants::DECREASE_FONT_SIZE, + modecontext); + cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+-"))); + connect(a, SIGNAL(triggered()), m_centralWidget, SLOT(zoomOut())); + advancedMenu->addAction(cmd, Core::Constants::G_EDIT_FONT); + } + return true; } -- GitLab