Mercurial > octave-nkf
comparison libgui/src/m-editor/octave-qscintilla.cc @ 18459:f01ac1bb8a5d gui-release
add menu entries and shortcuts for zoom functions in the editor (bug #41516)
* file-editor.cc (zoom_in): slot for zoom-in action, triggering signal for tab;
(zoom_out): slot for zoom-out action, triggering signal for tab;
(zoom_normal): slot for zoom-to-normal action, triggering signal for tab;
(construct): new View-menu with zoom-in, zoom-out and zoom-normal entries;
(add_file_editor_tab): connect zoom-signal to newly created tabs;
(set_shortcuts): set shortcuts for new zoom actions;
(check_actions): disable zoom action when no editor tab is open
* file-editor.h: zoom-in, zoom-out and zoom-normal actions, related slots
and related signals to the actual tab
* file-editor-tab.cc (zoom_in): new slot for signal from file_editor;
(zoom_out): new slot for signal from file_editor;
(zoom_normal): new slot for signal from file_editor
* file-editor-tab.h: new slots zoom_in, zoom_out, zoom_normal
* octave-qscintilla.cc (eventFilter): event filter for overriding qscintilla
internal shortcuts;
(constructor): install event filter
* octave-qscintilla.h: event filter
author | Torsten <ttl@justmail.de> |
---|---|
date | Thu, 13 Feb 2014 20:39:09 +0100 |
parents | 86c6ae5f969e |
children | f959c63934e6 |
comparison
equal
deleted
inserted
replaced
18458:ebb878596bcf | 18459:f01ac1bb8a5d |
---|---|
27 #endif | 27 #endif |
28 | 28 |
29 #ifdef HAVE_QSCINTILLA | 29 #ifdef HAVE_QSCINTILLA |
30 | 30 |
31 #include <Qsci/qscilexer.h> | 31 #include <Qsci/qscilexer.h> |
32 #include <QShortcut> | |
32 | 33 |
33 #include "octave-qscintilla.h" | 34 #include "octave-qscintilla.h" |
34 #include "file-editor-tab.h" | 35 #include "file-editor-tab.h" |
35 | 36 |
36 octave_qscintilla::octave_qscintilla (QWidget *p) | 37 octave_qscintilla::octave_qscintilla (QWidget *p) |
37 : QsciScintilla (p) | 38 : QsciScintilla (p) |
38 { } | 39 { |
40 installEventFilter (this); | |
41 } | |
39 | 42 |
40 octave_qscintilla::~octave_qscintilla () | 43 octave_qscintilla::~octave_qscintilla () |
41 { } | 44 { } |
42 | 45 |
43 void | 46 void |
184 QString::SkipEmptyParts); | 187 QString::SkipEmptyParts); |
185 for (int i = 0; i < commands.size (); i++ ) | 188 for (int i = 0; i < commands.size (); i++ ) |
186 emit execute_command_in_terminal_signal (commands.at (i)); | 189 emit execute_command_in_terminal_signal (commands.at (i)); |
187 } | 190 } |
188 | 191 |
192 bool | |
193 octave_qscintilla::eventFilter(QObject *obj, QEvent *e) | |
194 { | |
195 if (e->type() == QEvent::ShortcutOverride) | |
196 return true; | |
197 else | |
198 return QObject::eventFilter(obj, e); | |
199 } | |
200 | |
189 #endif | 201 #endif |