ecode: Added an option to show relative lines position.

This commit is contained in:
Martín Lucas Golini
2023-03-12 22:05:57 -03:00
parent a78cdadfc3
commit de59ee7423
6 changed files with 35 additions and 3 deletions

View File

@@ -1085,6 +1085,9 @@ UIMenu* SettingsMenu::createViewMenu() {
mViewMenu->addCheckBox( i18n( "highlight_matching_brackets", "Highlight Matching Bracket" ) )
->setActive( mApp->getConfig().editor.highlightMatchingBracket )
->setId( "highlight-matching-brackets" );
mViewMenu->addCheckBox( i18n( "show_lines_relative_position", "Show Lines Relative Position" ) )
->setActive( mApp->getConfig().editor.linesRelativePosition )
->setId( "show-lines-relative-position" );
mViewMenu->addCheckBox( i18n( "highlight_current_line", "Highlight Current Line" ) )
->setActive( mApp->getConfig().editor.highlightCurrentLine )
->setId( "highlight-current-line" );
@@ -1166,6 +1169,12 @@ UIMenu* SettingsMenu::createViewMenu() {
mSplitter->forEachEditor( [&]( UICodeEditor* editor ) {
editor->showMinimap( mApp->getConfig().editor.minimap );
} );
} else if ( item->getId() == "show-lines-relative-position" ) {
mApp->getConfig().editor.linesRelativePosition =
item->asType<UIMenuCheckBox>()->isActive();
mSplitter->forEachEditor( [&]( UICodeEditor* editor ) {
editor->showLinesRelativePosition( mApp->getConfig().editor.linesRelativePosition );
} );
} else if ( item->getId() == "highlight-matching-brackets" ) {
mApp->getConfig().editor.highlightMatchingBracket =
item->asType<UIMenuCheckBox>()->isActive();