# HG changeset patch # User Torsten # Date 1392755931 -3600 # Node ID 6eae8ba32e62ed0eb49ee3b4f3c988d251e1bc8b # Parent ca65b05b9a8afdc4f5250bd75a222ce5bc0726cc 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 diff -r ca65b05b9a8a -r 6eae8ba32e62 libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc Tue Feb 18 02:50:18 2014 -0500 +++ b/libgui/src/m-editor/file-editor-tab.cc Tue Feb 18 21:38:51 2014 +0100 @@ -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 diff -r ca65b05b9a8a -r 6eae8ba32e62 libgui/src/settings-dialog.cc --- a/libgui/src/settings-dialog.cc Tue Feb 18 02:50:18 2014 -0500 +++ b/libgui/src/settings-dialog.cc Tue Feb 18 21:38:51 2014 +0100 @@ -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", diff -r ca65b05b9a8a -r 6eae8ba32e62 libgui/src/settings-dialog.ui --- a/libgui/src/settings-dialog.ui Tue Feb 18 02:50:18 2014 -0500 +++ b/libgui/src/settings-dialog.ui Tue Feb 18 21:38:51 2014 +0100 @@ -389,7 +389,7 @@ 0 0 662 - 419 + 470 @@ -397,7 +397,7 @@ - + 6 @@ -440,19 +440,6 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -525,32 +512,6 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -630,6 +591,56 @@ + + + + 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. + + + Draw a long line marker + + + true + + + + + + + + + After Column + + + + + + + 2 + + + 256 + + + 80 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + @@ -778,9 +789,6 @@ - - 0 - @@ -800,9 +808,6 @@ - - 0 - @@ -930,6 +935,19 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -943,19 +961,6 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -2195,5 +2200,37 @@ + + editor_long_line_marker + toggled(bool) + editor_long_line_column + setEnabled(bool) + + + 145 + 187 + + + 355 + 187 + + + + + editor_long_line_marker + toggled(bool) + editor_long_line_column_text + setEnabled(bool) + + + 145 + 187 + + + 302 + 187 + + +