From 86b5fc02f59626df5e627e6cefac5be03c199385 Mon Sep 17 00:00:00 2001 From: don bright Date: Sun, 22 Jul 2012 20:56:01 -0500 Subject: on control + mousewheel, zoomin/zoomout text (like firefox, IE, etc) diff --git a/src/editor.cc b/src/editor.cc index f237c2e..5282677 100644 --- a/src/editor.cc +++ b/src/editor.cc @@ -97,4 +97,14 @@ void Editor::zoomOut() this->setFont( tmp_font ); } +void Editor::wheelEvent ( QWheelEvent * event ) +{ + if (event->modifiers() == Qt::ControlModifier) { + if (event->delta() > 0 ) + zoomIn(); + else if (event->delta() < 0 ) + zoomOut(); + } +} + #endif diff --git a/src/editor.h b/src/editor.h index 509cf24..bb338b0 100644 --- a/src/editor.h +++ b/src/editor.h @@ -1,6 +1,7 @@ #include #include #include +#include #ifdef _QCODE_EDIT_ #include @@ -33,5 +34,7 @@ public slots: void unindentSelection(); void commentSelection(); void uncommentSelection(); +private: + void wheelEvent ( QWheelEvent * event ); #endif }; -- cgit v0.10.1