changeset 19464:472a5572849c gui-release

hiding horizontal scroll bar in editor when not needed (bug #41592) * file-editor-tab.cc (notice_settings): only show horizontal scroll bar if set in the settings and set scroll size to -1 (no scroll bar if not needed) * settings-dialog.ui: new checkbox for enabling horizontal scroll bar * settings-dialog.cc (ctor): init new checkbox with value from settings file; (write_changed_settings): write state from new checkbox into settings file
author Torsten <ttl@justmail.de>
date Fri, 26 Dec 2014 09:10:38 +0100
parents be53bf420464
children bd27cd403d00
files libgui/src/m-editor/file-editor-tab.cc libgui/src/settings-dialog.cc libgui/src/settings-dialog.ui
diffstat 3 files changed, 24 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc	Thu Dec 25 15:48:43 2014 +0100
+++ b/libgui/src/m-editor/file-editor-tab.cc	Fri Dec 26 09:10:38 2014 +0100
@@ -1904,6 +1904,10 @@
   _edit_area->setTabWidth
         (settings->value ("editor/tab_width",2).toInt ());
 
+  _edit_area->SendScintilla (QsciScintillaBase::SCI_SETHSCROLLBAR,
+        settings->value ("editor/show_hscroll_bar",true).toBool ());
+  _edit_area->SendScintilla (QsciScintillaBase::SCI_SETSCROLLWIDTH,-1);
+
   _long_title = settings->value ("editor/longWindowTitle", false).toBool ();
   update_window_title (_edit_area->isModified ());
 
--- a/libgui/src/settings-dialog.cc	Thu Dec 25 15:48:43 2014 +0100
+++ b/libgui/src/settings-dialog.cc	Fri Dec 26 09:10:38 2014 +0100
@@ -206,6 +206,9 @@
     settings->value ("editor/show_white_space_indent",false).toBool ());
   ui->cb_show_eol->setChecked (
     settings->value ("editor/show_eol_chars",false).toBool () );
+  ui->cb_show_hscrollbar->setChecked (
+    settings->value ("editor/show_hscroll_bar",true).toBool ());
+
 #ifdef HAVE_QSCINTILLA
 #if defined (Q_OS_WIN32)
   int eol_mode = QsciScintilla::EolWindows;
@@ -679,6 +682,8 @@
                       ui->editor_ws_indent_checkbox->isChecked ());
   settings->setValue ("editor/show_eol_chars",
                       ui->cb_show_eol->isChecked ());
+  settings->setValue ("editor/show_hscroll_bar",
+                      ui->cb_show_hscrollbar->isChecked ());
   settings->setValue ("editor/default_eol_mode",
                       ui->combo_eol_mode->currentIndex ());
   settings->setValue ("editor/auto_indent",
--- a/libgui/src/settings-dialog.ui	Thu Dec 25 15:48:43 2014 +0100
+++ b/libgui/src/settings-dialog.ui	Fri Dec 26 09:10:38 2014 +0100
@@ -32,7 +32,7 @@
       </size>
      </property>
      <property name="currentIndex">
-      <number>0</number>
+      <number>1</number>
      </property>
      <widget class="QWidget" name="tab_general">
       <property name="enabled">
@@ -454,7 +454,7 @@
             <x>0</x>
             <y>0</y>
             <width>662</width>
-            <height>634</height>
+            <height>661</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_16">
@@ -782,6 +782,19 @@
                  </item>
                 </layout>
                </item>
+               <item row="9" column="0">
+                <widget class="QCheckBox" name="cb_show_hscrollbar">
+                 <property name="enabled">
+                  <bool>true</bool>
+                 </property>
+                 <property name="text">
+                  <string>Show horizontal scroll bar</string>
+                 </property>
+                 <property name="checked">
+                  <bool>true</bool>
+                 </property>
+                </widget>
+               </item>
               </layout>
              </item>
              <item>