aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-12-08 17:08:06 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-12-08 17:08:06 +0000
commit710194c1cc6399878eadda84c23f7a52e7baa879 (patch)
tree68d081a12b2b0a6ab23e29b11443247e04f0a318
parentupdated TODO (diff)
downloadgpg4usb-710194c1cc6399878eadda84c23f7a52e7baa879.tar.gz
gpg4usb-710194c1cc6399878eadda84c23f7a52e7baa879.zip
added zoom in/out to textedit
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@677 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r--mainwindow.cpp11
-rw-r--r--mainwindow.h2
-rw-r--r--textedit.cpp18
-rw-r--r--textedit.h2
4 files changed, 33 insertions, 0 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp
index e6242c0..58267ae 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -206,6 +206,14 @@ void MainWindow::createActions()
redoAct->setToolTip(tr("Redo Last Edit Action"));
connect(redoAct, SIGNAL(triggered()), edit, SLOT(redo()));
+ zoomInAct = new QAction(tr("Zoom In"), this);
+ zoomInAct->setShortcut(QKeySequence::ZoomIn);
+ connect(zoomInAct, SIGNAL(triggered()), edit, SLOT(zoomIn()));
+
+ zoomOutAct = new QAction(tr("Zoom Out"), this);
+ zoomOutAct->setShortcut(QKeySequence::ZoomOut);
+ connect(zoomOutAct, SIGNAL(triggered()), edit, SLOT(zoomOut()));
+
pasteAct = new QAction(tr("&Paste"), this);
pasteAct->setIcon(QIcon(iconPath + "button_paste.png"));
pasteAct->setShortcut(QKeySequence::Paste);
@@ -370,6 +378,9 @@ void MainWindow::createMenus()
editMenu->addAction(undoAct);
editMenu->addAction(redoAct);
editMenu->addSeparator();
+ editMenu->addAction(zoomInAct);
+ editMenu->addAction(zoomOutAct);
+ editMenu->addSeparator();
editMenu->addAction(copyAct);
editMenu->addAction(cutAct);
editMenu->addAction(pasteAct);
diff --git a/mainwindow.h b/mainwindow.h
index 16ee618..3106371 100644
--- a/mainwindow.h
+++ b/mainwindow.h
@@ -275,6 +275,8 @@ private:
QAction *selectallAct; /** Action to select whole text */
QAction *undoAct; /** Action to undo last action */
QAction *redoAct; /** Action to redo last action */
+ QAction *zoomInAct; /** Action to zoom in */
+ QAction *zoomOutAct; /** Action to zoom out */
QAction *aboutAct; /** Action to open about dialog */
QAction *fileEncryptionAct; /** Action to open file-encryption dialog */
QAction *fileEncryptAct; /** Action to open dialog for encrypting file */
diff --git a/textedit.cpp b/textedit.cpp
index f69715b..b3b9f58 100644
--- a/textedit.cpp
+++ b/textedit.cpp
@@ -497,6 +497,24 @@ void TextEdit::redo()
curTextPage()->redo();
}
+void TextEdit::zoomIn()
+{
+ if (tabWidget->count() == 0 || curTextPage() == 0) {
+ return;
+ }
+
+ curTextPage()->zoomIn();
+}
+
+void TextEdit::zoomOut()
+{
+ if (tabWidget->count() == 0 || curTextPage() == 0) {
+ return;
+ }
+
+ curTextPage()->zoomOut();
+}
+
void TextEdit::selectAll()
{
if (tabWidget->count() == 0 || curTextPage() == 0) {
diff --git a/textedit.h b/textedit.h
index bdbd62a..4b5a1b3 100644
--- a/textedit.h
+++ b/textedit.h
@@ -239,6 +239,8 @@ private slots:
*/
void redo();
+ void zoomIn();
+ void zoomOut();
/****************************************************************************************
* Name: selectAll
* Description: select all in current textpage