Mercurial > hg > octave-jordi
changeset 21000:1c91ff4cf9ec
add a menu entry for showing/hiding the editor status bar
* file-editor.cc (show_statusbar): new slot;
(notice_settings): check menu entry depending on settings, showing/hiding
status bar is don ein the editor tabs;
(construct): add new action to the view menu;
(set_shortcuts): set the shortcut for the new action
* file-editor.h: new action with new slot
* shortcut-manager.cc (do_init_data) initialize shortcut data for show
toolbar and statusbar action
author | Torsten <ttl@justmail.de> |
---|---|
date | Mon, 28 Dec 2015 19:50:49 +0100 |
parents | 85dfb551e4cd |
children | 314245afff3a |
files | libgui/src/m-editor/file-editor.cc libgui/src/m-editor/file-editor.h libgui/src/shortcut-manager.cc |
diffstat | 3 files changed, 20 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc +++ b/libgui/src/m-editor/file-editor.cc @@ -1257,6 +1257,11 @@ { toggle_preference ("editor/show_toolbar",true); } +void +file_editor::show_statusbar (bool) +{ + toggle_preference ("editor/show_edit_status_bar",true); +} void file_editor::zoom_in (bool) @@ -1349,6 +1354,8 @@ show_it = settings->value ("editor/show_toolbar",true).toBool (); _show_toolbar_action->setChecked (show_it); _tool_bar->setVisible (show_it); + show_it = settings->value ("editor/show_edit_status_bar",true).toBool (); + _show_statusbar_action->setChecked (show_it); set_shortcuts (); @@ -1687,10 +1694,16 @@ tr ("Show Long Line &Marker"), SLOT (show_long_line (bool))); _show_longline_action->setCheckable (true); + _view_editor_menu->addSeparator (); + _show_toolbar_action = add_action (_view_editor_menu, QIcon (), tr ("Show &Toolbar"), SLOT (show_toolbar (bool))); _show_toolbar_action->setCheckable (true); + _show_statusbar_action = add_action (_view_editor_menu, QIcon (), + tr ("Show &Statusbar"), SLOT (show_statusbar (bool))); + _show_statusbar_action->setCheckable (true); + view_menu->addSeparator (); _zoom_in_action = add_action (view_menu, resource_manager::icon ("zoom-in"), @@ -2112,6 +2125,7 @@ shortcut_manager::set_shortcut (_show_indguide_action, "editor_view:show_ind_guides"); shortcut_manager::set_shortcut (_show_longline_action, "editor_view:show_long_line"); shortcut_manager::set_shortcut (_show_toolbar_action, "editor_view:show_toolbar"); + shortcut_manager::set_shortcut (_show_statusbar_action, "editor_view:show_statusbar"); shortcut_manager::set_shortcut (_zoom_in_action, "editor_view:zoom_in"); shortcut_manager::set_shortcut (_zoom_out_action, "editor_view:zoom_out"); shortcut_manager::set_shortcut (_zoom_normal_action, "editor_view:zoom_normal");
--- a/libgui/src/m-editor/file-editor.h +++ b/libgui/src/m-editor/file-editor.h @@ -274,6 +274,7 @@ void show_indent_guides (bool); void show_long_line (bool); void show_toolbar (bool); + void show_statusbar (bool); void zoom_in (bool); void zoom_out (bool); void zoom_normal (bool); @@ -350,6 +351,7 @@ QAction *_show_indguide_action; QAction *_show_longline_action; QAction *_show_toolbar_action; + QAction *_show_statusbar_action; QAction *_zoom_in_action; QAction *_zoom_out_action; QAction *_zoom_normal_action;
--- a/libgui/src/shortcut-manager.cc +++ b/libgui/src/shortcut-manager.cc @@ -283,6 +283,10 @@ QKeySequence ()); init (tr ("Show Long Line Marker"), "editor_view:show_long_line", QKeySequence ()); + init (tr ("Show Toolbar"), "editor_view:show_toolbar", + QKeySequence ()); + init (tr ("Show Statusbar"), "editor_view:show_statusbar", + QKeySequence ()); init (tr ("Zoom In"), "editor_view:zoom_in", QKeySequence::ZoomIn); init (tr ("Zoom Out"), "editor_view:zoom_out", QKeySequence::ZoomOut); #if defined (Q_OS_MAC)