aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/texteditoractionhandler.cpp
diff options
context:
space:
mode:
authorFlorian Koch <devfk@outlook.com>2022-08-28 19:32:07 +0200
committerFlorian Koch <devfk@outlook.com>2022-09-12 16:40:15 +0000
commit69fad91660ea52b30daffa7e9507163134edf68b (patch)
tree53061d652550ed9a62bef62fe3d86fb9992da3d3 /src/plugins/texteditor/texteditoractionhandler.cpp
parent0f2ade49f9819ee8ca63c5ee75bb66560e5760cc (diff)
Re-introduction of the feature to adjust the line spacing
This already has been implemented in change dc64f3207bdf6c0d295859e47791cb8193e67f4e, but was reverted with change f220cb0e23729ddccf52c25dae4e4696641bc62d) because this does not work with text wrapping rendering, due to internal limitations of Qt. Since this is a highly requested feature (e.g. QTCREATORBUG-13727), but an internal change within Qt is not in sight, the approach taken here is to offer the text wrapping feature in the settings only when the line spacing is set to 100%. Additionally, a change has been made to the layout of the display settings page to reflect this. Fixes: QTCREATORBUG-13727 Change-Id: Ib233cf90a5f336bc591fa1bf860e162fa774dfe3 Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/texteditor/texteditoractionhandler.cpp')
-rw-r--r--src/plugins/texteditor/texteditoractionhandler.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp
index 2fe72ab27e..302a5f6f89 100644
--- a/src/plugins/texteditor/texteditoractionhandler.cpp
+++ b/src/plugins/texteditor/texteditoractionhandler.cpp
@@ -5,9 +5,11 @@
#include "texteditor.h"
#include "displaysettings.h"
+#include "fontsettings.h"
#include "linenumberfilter.h"
#include "texteditorconstants.h"
#include "texteditorplugin.h"
+#include "texteditorsettings.h"
#include <aggregation/aggregate.h>
@@ -134,6 +136,8 @@ TextEditorActionHandlerPrivate::TextEditorActionHandlerPrivate
createActions();
connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged,
this, &TextEditorActionHandlerPrivate::updateCurrentEditor);
+ connect(TextEditorSettings::instance(), &TextEditorSettings::fontSettingsChanged,
+ this, &TextEditorActionHandlerPrivate::updateActions);
}
void TextEditorActionHandlerPrivate::createActions()
@@ -448,7 +452,12 @@ void TextEditorActionHandlerPrivate::updateActions()
a->setEnabled(isWritable);
m_unCommentSelectionAction->setEnabled((m_optionalActions & TextEditorActionHandler::UnCommentSelection) && isWritable);
m_visualizeWhitespaceAction->setEnabled(m_currentEditorWidget);
- m_textWrappingAction->setEnabled(m_currentEditorWidget);
+ if (TextEditorSettings::fontSettings().relativeLineSpacing() == 100) {
+ m_textWrappingAction->setEnabled(m_currentEditorWidget);
+ } else {
+ m_textWrappingAction->setEnabled(false);
+ m_textWrappingAction->setChecked(false);
+ }
if (m_currentEditorWidget) {
m_visualizeWhitespaceAction->setChecked(
m_currentEditorWidget->displaySettings().m_visualizeWhitespace);