]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt4/GuiWorkArea.cpp
Fix bug #3038: wish for lfuns for zoom-in and zoom-out
[features.git] / src / frontends / qt4 / GuiWorkArea.cpp
index 344b63044cda63b3a47c22171b9817c4a17dd7b0..2d379462d706af94397dea114b2277a6ce367ca2 100644 (file)
@@ -43,6 +43,7 @@
 #include "graphics/GraphicsImage.h"
 #include "graphics/GraphicsLoader.h"
 
+#include "support/convert.h"
 #include "support/debug.h"
 #include "support/gettext.h"
 #include "support/FileName.h"
@@ -810,15 +811,8 @@ void GuiWorkArea::wheelEvent(QWheelEvent * ev)
        // documentation of QWheelEvent)
        int const delta = ev->delta() / 120;
        if (ev->modifiers() & Qt::ControlModifier) {
-               lyxrc.zoom += 5 * delta;
-               if (lyxrc.zoom < 10)
-                       lyxrc.zoom = 10;
-               // The global QPixmapCache is used in GuiPainter to cache text
-               // painting so we must reset it.
-               QPixmapCache::clear();
-               guiApp->fontLoader().update();
-               ev->accept();
-               lyx::dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
+               docstring arg = convert<docstring>(5 * delta);
+               lyx::dispatch(FuncRequest(LFUN_BUFFER_ZOOM_IN, arg));
                return;
        }