Commit 7be8f1ac authored by Laurent Montel's avatar Laurent Montel 😁

Allow to zoom code

parent 3230addf
......@@ -446,6 +446,28 @@ void SieveEditorMainWidget::slotScriptModified(bool modified, SieveEditorPageWid
}
}
void SieveEditorMainWidget::slotZoomIn()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->zoomIn();
}
}
}
void SieveEditorMainWidget::slotZoomOut()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->zoomOut();
}
}
}
void SieveEditorMainWidget::slotGeneralPaletteChanged()
{
const QPalette pal = palette();
......
......@@ -71,6 +71,9 @@ public Q_SLOTS:
void slotSentenceCase();
void slotLowerCase();
void slotReverseCase();
void slotZoomIn();
void slotZoomOut();
Q_SIGNALS:
void updateButtons(bool newScriptAction, bool editScriptAction, bool deleteScriptAction, bool desactivateScriptAction);
void updateScriptList();
......
......@@ -196,6 +196,12 @@ void SieveEditorMainWindow::setupActions()
mUncommentAction = ac->addAction(QStringLiteral("uncomment_code"), mMainWidget->sieveEditorMainWidget(), SLOT(slotUncomment()));
mUncommentAction->setText(i18n("Uncomment"));
mZoomInAction = ac->addAction(QStringLiteral("zoom_in"), mMainWidget->sieveEditorMainWidget(), SLOT(slotZoomIn()));
mZoomInAction->setText(i18n("Zoom In"));
mZoomOutAction = ac->addAction(QStringLiteral("zoom_out"), mMainWidget->sieveEditorMainWidget(), SLOT(slotZoomOut()));
mZoomOutAction->setText(i18n("Zoom Out"));
mMenuChangeCaseAction = new PimCommon::KActionMenuChangeCase(this);
ac->addAction(QStringLiteral("change_case_menu"), mMenuChangeCaseAction);
mMenuChangeCaseAction->appendInActionCollection(ac);
......@@ -296,6 +302,8 @@ void SieveEditorMainWindow::slotUpdateActions()
mCommentAction->setEnabled(editActionEnabled);
mUncommentAction->setEnabled(editActionEnabled);
mMenuChangeCaseAction->setEnabled(editActionEnabled);
mZoomInAction->setEnabled(editActionEnabled);
mZoomOutAction->setEnabled(editActionEnabled);
}
void SieveEditorMainWindow::slotUndoAvailable(bool b)
......
......@@ -86,6 +86,8 @@ private:
QAction *mAutoGenerateScriptAction;
QAction *mCommentAction;
QAction *mUncommentAction;
QAction *mZoomInAction;
QAction *mZoomOutAction;
PimCommon::KActionMenuChangeCase *mMenuChangeCaseAction;
QLabel *mStatusBarInfo;
......
......@@ -292,3 +292,13 @@ void SieveEditorPageWidget::selectAll()
{
mSieveEditorWidget->selectAll();
}
void SieveEditorPageWidget::zoomIn()
{
mSieveEditorWidget->zoomIn();
}
void SieveEditorPageWidget::zoomOut()
{
mSieveEditorWidget->zoomOut();
}
......@@ -73,6 +73,8 @@ public:
void upperCase();
void sentenceCase();
void reverseCase();
void zoomIn();
void zoomOut();
Q_SIGNALS:
void refreshList();
void scriptModified(bool, SieveEditorPageWidget *);
......
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="sieveeditor" version="8">
<kpartgui name="sieveeditor" version="9">
<MenuBar>
<Menu name="file" >
<Action name="add_server_sieve" />
......@@ -27,6 +27,9 @@
<Action name="uncomment_code" />
<Separator/>
<Action name="change_case_menu" />
<Separator/>
<Action name="zoom_in" />
<Action name="zoom_out" />
</Menu>
<Menu name="Tools" >
<text>Tools</text>
......
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