Mercurial > octave-nkf
diff libgui/src/m-editor/file-editor-tab.cc @ 18573:26d15a57f45b 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 (constructor): disable the shortcuts qscintilla uses
for the zoom-actions in order to be able to use own functions
author | Torsten <ttl@justmail.de> |
---|---|
date | Thu, 13 Feb 2014 20:39:09 +0100 |
parents | 2d5d0d86432e |
children | 1b289f45187f |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc Mon Mar 10 10:46:37 2014 -0500 +++ b/libgui/src/m-editor/file-editor-tab.cc Thu Feb 13 20:39:09 2014 +0100 @@ -776,6 +776,37 @@ void +file_editor_tab::zoom_in (const QWidget *ID) +{ + if (ID != this) + return; + + _edit_area->zoomIn (1); + auto_margin_width (); +} + +void +file_editor_tab::zoom_out (const QWidget *ID) +{ + if (ID != this) + return; + + _edit_area->zoomOut (1); + auto_margin_width (); +} + +void +file_editor_tab::zoom_normal (const QWidget *ID) +{ + if (ID != this) + return; + + _edit_area->zoomTo (0); + auto_margin_width (); +} + + +void file_editor_tab::handle_find_dialog_finished (int) { // Find dialog is going to hide. Save location of window for