Mercurial > octave-dspies
comparison libgui/src/m-editor/file-editor-tab.cc @ 18560: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 |
comparison
equal
deleted
inserted
replaced
18557:ca1648b2e673 | 18560:26d15a57f45b |
---|---|
774 do_indent_selected_text (false); | 774 do_indent_selected_text (false); |
775 } | 775 } |
776 | 776 |
777 | 777 |
778 void | 778 void |
779 file_editor_tab::zoom_in (const QWidget *ID) | |
780 { | |
781 if (ID != this) | |
782 return; | |
783 | |
784 _edit_area->zoomIn (1); | |
785 auto_margin_width (); | |
786 } | |
787 | |
788 void | |
789 file_editor_tab::zoom_out (const QWidget *ID) | |
790 { | |
791 if (ID != this) | |
792 return; | |
793 | |
794 _edit_area->zoomOut (1); | |
795 auto_margin_width (); | |
796 } | |
797 | |
798 void | |
799 file_editor_tab::zoom_normal (const QWidget *ID) | |
800 { | |
801 if (ID != this) | |
802 return; | |
803 | |
804 _edit_area->zoomTo (0); | |
805 auto_margin_width (); | |
806 } | |
807 | |
808 | |
809 void | |
779 file_editor_tab::handle_find_dialog_finished (int) | 810 file_editor_tab::handle_find_dialog_finished (int) |
780 { | 811 { |
781 // Find dialog is going to hide. Save location of window for | 812 // Find dialog is going to hide. Save location of window for |
782 // when it is reshown. | 813 // when it is reshown. |
783 _find_dialog_geometry = _find_dialog->geometry (); | 814 _find_dialog_geometry = _find_dialog->geometry (); |