comparison libgui/src/m-editor/file-editor-tab.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 770c525a1a2b
children f959c63934e6
comparison
equal deleted inserted replaced
18458:ebb878596bcf 18459:f01ac1bb8a5d
765 do_indent_selected_text (false); 765 do_indent_selected_text (false);
766 } 766 }
767 767
768 768
769 void 769 void
770 file_editor_tab::zoom_in (const QWidget *ID)
771 {
772 if (ID != this)
773 return;
774
775 _edit_area->zoomIn (1);
776 auto_margin_width ();
777 }
778
779 void
780 file_editor_tab::zoom_out (const QWidget *ID)
781 {
782 if (ID != this)
783 return;
784
785 _edit_area->zoomOut (1);
786 auto_margin_width ();
787 }
788
789 void
790 file_editor_tab::zoom_normal (const QWidget *ID)
791 {
792 if (ID != this)
793 return;
794
795 _edit_area->zoomTo (0);
796 auto_margin_width ();
797 }
798
799
800 void
770 file_editor_tab::handle_find_dialog_finished (int) 801 file_editor_tab::handle_find_dialog_finished (int)
771 { 802 {
772 // Find dialog is going to hide. Save location of window for 803 // Find dialog is going to hide. Save location of window for
773 // when it is reshown. 804 // when it is reshown.
774 _find_dialog_geometry = _find_dialog->geometry (); 805 _find_dialog_geometry = _find_dialog->geometry ();