Commit 67a54bd8 authored by Simone Gaiarin's avatar Simone Gaiarin Committed by Albert Astals Cid
Browse files

Save zoom mouse mode action to a variable

parent 44f7a6de
...@@ -228,6 +228,7 @@ public: ...@@ -228,6 +228,7 @@ public:
KToggleAction *aTrimMargins; KToggleAction *aTrimMargins;
KToggleAction *aReadingDirection; KToggleAction *aReadingDirection;
QAction *aMouseNormal; QAction *aMouseNormal;
QAction *aMouseZoom;
QAction *aMouseSelect; QAction *aMouseSelect;
QAction *aMouseTextSelect; QAction *aMouseTextSelect;
QAction *aMouseTableSelect; QAction *aMouseTableSelect;
...@@ -364,6 +365,7 @@ PageView::PageView(QWidget *parent, Okular::Document *document) ...@@ -364,6 +365,7 @@ PageView::PageView(QWidget *parent, Okular::Document *document)
d->aTrimToSelection = nullptr; d->aTrimToSelection = nullptr;
d->aReadingDirection = nullptr; d->aReadingDirection = nullptr;
d->aMouseNormal = nullptr; d->aMouseNormal = nullptr;
d->aMouseZoom = nullptr;
d->aMouseSelect = nullptr; d->aMouseSelect = nullptr;
d->aMouseTextSelect = nullptr; d->aMouseTextSelect = nullptr;
d->aSignature = nullptr; d->aSignature = nullptr;
...@@ -661,13 +663,13 @@ void PageView::setupViewerActions(KActionCollection *ac) ...@@ -661,13 +663,13 @@ void PageView::setupViewerActions(KActionCollection *ac)
d->aMouseNormal->setActionGroup(d->mouseModeActionGroup); d->aMouseNormal->setActionGroup(d->mouseModeActionGroup);
d->aMouseNormal->setChecked(Okular::Settings::mouseMode() == Okular::Settings::EnumMouseMode::Browse); d->aMouseNormal->setChecked(Okular::Settings::mouseMode() == Okular::Settings::EnumMouseMode::Browse);
QAction *mz = new QAction(QIcon::fromTheme(QStringLiteral("page-zoom")), i18n("&Zoom"), this); d->aMouseZoom = new QAction(QIcon::fromTheme(QStringLiteral("page-zoom")), i18n("&Zoom"), this);
ac->addAction(QStringLiteral("mouse_zoom"), mz); ac->addAction(QStringLiteral("mouse_zoom"), d->aMouseZoom);
connect(mz, &QAction::triggered, this, &PageView::slotSetMouseZoom); connect(d->aMouseZoom, &QAction::triggered, this, &PageView::slotSetMouseZoom);
mz->setCheckable(true); d->aMouseZoom->setCheckable(true);
ac->setDefaultShortcut(mz, QKeySequence(Qt::CTRL | Qt::Key_2)); ac->setDefaultShortcut(d->aMouseZoom, QKeySequence(Qt::CTRL | Qt::Key_2));
mz->setActionGroup(d->mouseModeActionGroup); d->aMouseZoom->setActionGroup(d->mouseModeActionGroup);
mz->setChecked(Okular::Settings::mouseMode() == Okular::Settings::EnumMouseMode::Zoom); d->aMouseZoom->setChecked(Okular::Settings::mouseMode() == Okular::Settings::EnumMouseMode::Zoom);
d->aColorModeMenu = new ColorModeMenu(ac, this); d->aColorModeMenu = new ColorModeMenu(ac, this);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment