LFUN_INSET_BEGIN_SELECT, // JMarc, 20090316
LFUN_INSET_END_SELECT, // JMarc, 20090316
LFUN_SCREEN_SHOW_CURSOR, // vfr, 20090325
+ LFUN_BUFFER_ZOOM_IN, // vfr, 20090330
+ LFUN_BUFFER_ZOOM_OUT, // vfr, 20090330
LFUN_LASTACTION // end of the table
*/
{ LFUN_COPY_LABEL_AS_REF, "copy-label-as-reference", ReadOnly | NoUpdate, Edit },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_BUFFER_ZOOM_IN
+ * \li Action: Increases the zoom of the screen fonts.
+ * \li Syntax: buffer-zoom-in
+ * \li Origin: vfr, 30 Mar 2009
+ * \endvar
+ */
+ { LFUN_BUFFER_ZOOM_IN, "buffer-zoom-in", ReadOnly, Buffer },
+
+/*!
+ * \var lyx::FuncCode lyx::LFUN_BUFFER_ZOOM_OUT
+ * \li Action: Decreases the zoom of the screen fonts.
+ * \li Syntax: buffer-zoom-out
+ * \li Origin: vfr, 30 Mar 2009
+ * \endvar
+ */
+ { LFUN_BUFFER_ZOOM_OUT, "buffer-zoom-out", ReadOnly, Buffer },
+
{ LFUN_NOACTION, "", Noop, Hidden }
#ifndef DOXYGEN_SHOULD_SKIP_THIS
};
#include "Dialog.h"
#include "FileDialog.h"
+#include "FontLoader.h"
#include "GuiApplication.h"
#include "GuiCommandBuffer.h"
#include "GuiCompleter.h"
#include "Toolbars.h"
#include "version.h"
-#include "support/lassert.h"
+#include "support/convert.h"
#include "support/debug.h"
#include "support/ExceptionMessage.h"
#include "support/FileName.h"
#include "support/filetools.h"
#include "support/gettext.h"
#include "support/ForkedCalls.h"
+#include "support/lassert.h"
#include "support/lstrings.h"
#include "support/os.h"
#include "support/Package.h"
enable = false;
break;
- case LFUN_COMPLETION_CANCEL:
+ case LFUN_COMPLETION_CANCEL:
if (!d.current_work_area_
|| (!d.current_work_area_->completer().popupVisible()
&& !d.current_work_area_->completer().inlineVisible()))
enable = false;
break;
+ case LFUN_BUFFER_ZOOM_OUT:
+ enable = buf && lyxrc.zoom > 10;
+ break;
+
+ case LFUN_BUFFER_ZOOM_IN:
+ enable = buf;
+ break;
+
default:
return false;
}
d.current_work_area_->completer().activate();
break;
+ case LFUN_BUFFER_ZOOM_IN:
+ case LFUN_BUFFER_ZOOM_OUT:
+ if (cmd.argument().empty()) {
+ if (cmd.action == LFUN_BUFFER_ZOOM_IN)
+ lyxrc.zoom += 20;
+ else
+ lyxrc.zoom -= 20;
+ } else
+ lyxrc.zoom += convert<int>(cmd.argument());
+
+ 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();
+ lyx::dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
+ break;
default:
dispatched = false;
#include "graphics/GraphicsImage.h"
#include "graphics/GraphicsLoader.h"
+#include "support/convert.h"
#include "support/debug.h"
#include "support/gettext.h"
#include "support/FileName.h"
// 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;
}