Mercurial > hg > octave-nkf
changeset 18557:6eae8ba32e62 gui-release
provide a long line marker in the editor
* settings-dialog.ui: checkbox (enable) and spinbox (at column) for long line
marker settings
* settings-dialog.cc (constructor): insert line marker settings from file into
the settings dialog;
(write_changes_settings): write line marker settings from dialog into the file
* file-editor-tab.cc (notice_settings): read line marker settings from file
author | Torsten <ttl@justmail.de> |
---|---|
date | Tue, 18 Feb 2014 21:38:51 +0100 |
parents | ca65b05b9a8a |
children | 3cb0e58a071d |
files | libgui/src/m-editor/file-editor-tab.cc libgui/src/settings-dialog.cc libgui/src/settings-dialog.ui |
diffstat | 3 files changed, 114 insertions(+), 60 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc +++ b/libgui/src/m-editor/file-editor-tab.cc @@ -1448,6 +1448,13 @@ _long_title = settings->value ("editor/longWindowTitle", false).toBool (); update_window_title (_edit_area->isModified ()); + _edit_area->setEdgeColumn ( + settings->value ("editor/long_line_column",80).toInt ()); + if (settings->value ("editor/long_line_marker",true).toBool ()) + _edit_area->setEdgeMode (QsciScintilla::EdgeLine); + else + _edit_area->setEdgeMode (QsciScintilla::EdgeNone); + } void
--- a/libgui/src/settings-dialog.cc +++ b/libgui/src/settings-dialog.cc @@ -142,6 +142,10 @@ _editor_current_line_color, SLOT (setEnabled (bool))); ui->editor_highlightCurrentLine->setChecked ( settings->value ("editor/highlightCurrentLine",true).toBool () ); + ui->editor_long_line_marker->setChecked ( + settings->value ("editor/long_line_marker",true).toBool ()); + ui->editor_long_line_column->setValue ( + settings->value ("editor/long_line_column",80).toInt ()); ui->editor_codeCompletion->setChecked ( settings->value ("editor/codeCompletion", true).toBool () ); @@ -181,6 +185,8 @@ settings->value ("editor/restoreSession", true).toBool ()); ui->editor_create_new_file->setChecked ( settings->value ("editor/create_new_file",false).toBool ()); + + // terminal ui->terminal_fontName->setCurrentFont (QFont ( settings->value ("terminal/fontName","Courier New").toString ()) ); ui->terminal_fontSize->setValue ( @@ -542,6 +548,10 @@ ui->editor_highlightCurrentLine->isChecked ()); settings->setValue ("editor/highlight_current_line_color", _editor_current_line_color->color ()); + settings->setValue ("editor/long_line_marker", + ui->editor_long_line_marker->isChecked ()); + settings->setValue ("editor/long_line_column", + ui->editor_long_line_column->value ()); settings->setValue ("editor/codeCompletion", ui->editor_codeCompletion->isChecked ()); settings->setValue ("editor/codeCompletion_threshold",
--- a/libgui/src/settings-dialog.ui +++ b/libgui/src/settings-dialog.ui @@ -389,7 +389,7 @@ <x>0</x> <y>0</y> <width>662</width> - <height>419</height> + <height>470</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout_16"> @@ -397,7 +397,7 @@ <layout class="QVBoxLayout" name="verticalLayout_9"> <item> <layout class="QGridLayout" name="editor_common_settings_grid"> - <property name="spacing"> + <property name="horizontalSpacing"> <number>6</number> </property> <item row="3" column="0"> @@ -440,19 +440,6 @@ </property> </widget> </item> - <item row="4" column="4"> - <spacer name="horizontalSpacer_18"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> <item row="4" column="0"> <widget class="QCheckBox" name="editor_highlightCurrentLine"> <property name="enabled"> @@ -525,32 +512,6 @@ </property> </spacer> </item> - <item row="2" column="4"> - <spacer name="horizontalSpacer_16"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="3" column="4"> - <spacer name="horizontalSpacer_17"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> <item row="1" column="2"> <layout class="QGridLayout" name="gridLayout_6"> <item row="0" column="0"> @@ -630,6 +591,56 @@ </property> </spacer> </item> + <item row="5" column="0"> + <widget class="QCheckBox" name="editor_long_line_marker"> + <property name="toolTip"> + <string>This works well for monospaced fonts. The line is drawn at a position based on the width of a space character in the default font. It may not work very well if styles use proportional fonts or if varied font sizes or bold, italic and normal texts are used.</string> + </property> + <property name="text"> + <string>Draw a long line marker</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="5" column="2"> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <widget class="QLabel" name="editor_long_line_column_text"> + <property name="text"> + <string>After Column</string> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="editor_long_line_column"> + <property name="minimum"> + <number>2</number> + </property> + <property name="maximum"> + <number>256</number> + </property> + <property name="value"> + <number>80</number> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_7"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> </layout> </item> <item> @@ -778,9 +789,6 @@ </item> <item> <layout class="QGridLayout" name="gridLayout_2"> - <property name="verticalSpacing"> - <number>0</number> - </property> <item row="1" column="1"> <layout class="QHBoxLayout" name="horizontalLayout_2"> <property name="spacing"> @@ -800,9 +808,6 @@ </item> <item row="2" column="1"> <layout class="QGridLayout" name="gridLayout_3"> - <property name="verticalSpacing"> - <number>0</number> - </property> <item row="0" column="1"> <spacer name="horizontalSpacer_15"> <property name="orientation"> @@ -930,6 +935,19 @@ </property> </widget> </item> + <item row="0" column="3"> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> <item row="0" column="0"> <widget class="QCheckBox" name="editor_codeCompletion"> <property name="enabled"> @@ -943,19 +961,6 @@ </property> </widget> </item> - <item row="0" column="3"> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> </layout> </item> </layout> @@ -2195,5 +2200,37 @@ </hint> </hints> </connection> + <connection> + <sender>editor_long_line_marker</sender> + <signal>toggled(bool)</signal> + <receiver>editor_long_line_column</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>145</x> + <y>187</y> + </hint> + <hint type="destinationlabel"> + <x>355</x> + <y>187</y> + </hint> + </hints> + </connection> + <connection> + <sender>editor_long_line_marker</sender> + <signal>toggled(bool)</signal> + <receiver>editor_long_line_column_text</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>145</x> + <y>187</y> + </hint> + <hint type="destinationlabel"> + <x>302</x> + <y>187</y> + </hint> + </hints> + </connection> </connections> </ui>