Some changes in xdxf dialogs
[mdictionary] / src / mdictionary / gui / TranslationTextEdit.cpp
index 2f8fbc1..e7884d6 100644 (file)
@@ -47,9 +47,18 @@ TranslationTextEdit::TranslationTextEdit(QWidget *parent) :
     connect(page(), SIGNAL(selectionChanged()), this, SLOT(selection()));
 }
 
+void TranslationTextEdit::wheelEvent(QWheelEvent *e) {
+    if(e->modifiers() & Qt::ControlModifier) {
+        if(e->delta()>0) {
+            zoomIn();
+        }
+        else {
+            zoomOut();
+        }
+    }
+}
 
-bool TranslationTextEdit::eventFilter(QObject *, QEvent *e)
-{
+bool TranslationTextEdit::eventFilter(QObject *, QEvent *e) {
     switch (e->type()) {
     case QEvent::MouseButtonPress:
         if (static_cast<QMouseEvent *>(e)->button() == Qt::LeftButton)
@@ -62,7 +71,6 @@ bool TranslationTextEdit::eventFilter(QObject *, QEvent *e)
     case QEvent::MouseMove:
         if (mousePressed)
             return true;
-        break;
     default:
         break;
     }