summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/texteditor/texteditor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp
index 2d349cecb7..ac84aca67c 100644
--- a/src/plugins/texteditor/texteditor.cpp
+++ b/src/plugins/texteditor/texteditor.cpp
@@ -833,6 +833,10 @@ TextEditorWidgetPrivate::TextEditorWidgetPrivate(TextEditorWidget *parent)
m_fileLineEnding->addItems(ExtraEncodingSettings::lineTerminationModeNames());
m_fileLineEnding->setContentsMargins(spacing, 0, spacing, 0);
m_fileLineEndingAction = m_toolBar->addWidget(m_fileLineEnding);
+ m_fileLineEndingAction->setVisible(!q->isReadOnly());
+ connect(q, &TextEditorWidget::readOnlyChanged, this, [this] {
+ m_fileLineEndingAction->setVisible(!q->isReadOnly());
+ });
m_fileEncodingLabel = new FixedSizeClickLabel;
m_fileEncodingLabel->setContentsMargins(spacing, 0, spacing, 0);