diff libgui/src/m-editor/file-editor.cc @ 21002:314245afff3a

add a menu entry for showing/hiding the editor horizontal scrollbar * file-editor.cc (show_hscrollbar): new slot; (notice_settings): check menu entry depending on settings, showing/hiding horizontal scroll bar is done in 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 horizontal scrollbar action
author Torsten <ttl@justmail.de>
date Mon, 28 Dec 2015 20:35:51 +0100
parents 1c91ff4cf9ec
children 221847e5f488
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc	Mon Dec 28 19:50:49 2015 +0100
+++ b/libgui/src/m-editor/file-editor.cc	Mon Dec 28 20:35:51 2015 +0100
@@ -1262,6 +1262,11 @@
 {
   toggle_preference ("editor/show_edit_status_bar",true);
 }
+void
+file_editor::show_hscrollbar (bool)
+{
+  toggle_preference ("editor/show_hscroll_bar",true);
+}
 
 void
 file_editor::zoom_in (bool)
@@ -1356,6 +1361,8 @@
   _tool_bar->setVisible (show_it);
   show_it = settings->value ("editor/show_edit_status_bar",true).toBool ();
   _show_statusbar_action->setChecked (show_it);
+  show_it = settings->value ("editor/show_hscroll_bar",true).toBool ();
+  _show_hscrollbar_action->setChecked (show_it);
 
   set_shortcuts ();
 
@@ -1704,6 +1711,10 @@
           tr ("Show &Statusbar"), SLOT (show_statusbar (bool)));
   _show_statusbar_action->setCheckable (true);
 
+  _show_hscrollbar_action = add_action (_view_editor_menu, QIcon (),
+          tr ("Show &Horizontal Scrollbar"), SLOT (show_hscrollbar (bool)));
+  _show_hscrollbar_action->setCheckable (true);
+
   view_menu->addSeparator ();
 
   _zoom_in_action = add_action (view_menu, resource_manager::icon ("zoom-in"),
@@ -2126,6 +2137,7 @@
   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 (_show_hscrollbar_action, "editor_view:show_hscrollbar");
   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");