aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/texteditorsettings.cpp
Commit message (Collapse)AuthorAgeFilesLines
* TextEditor: Fix initial loading of behavior settingsOrgad Shaneh2024-04-021-3/+5
| | | | | | Fixes: QTCREATORBUG-30606 Change-Id: I1b4d8fd47e528d0868969cf883401037c0cfe9ee Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* TextEditor: bound increase and decreaseFontZoom to a 10% gridDavid Schulz2024-02-231-9/+22
| | | | | | | | This allows to get back to a 100% font zoom with the keyboard shortcuts by zooming to an odd zoom factor by other means. Change-Id: Ie90853367b17c207e9c47fc108b8d6f451e0f838 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* TextEditor: Simplify settings initializationOrgad Shaneh2024-02-151-13/+4
| | | | | | | | * Consolidate and simplify behaviorSettingsChanged callbacks. * Do not call the callbacks during initialization, they are called later. Change-Id: Ica4b601e091de2112c7737047cbffa8a98fc9f70 Reviewed-by: hjk <hjk@qt.io>
* TextEditor: Drop TextEditorSettings::m_instancehjk2024-02-151-7/+2
| | | | | | | | | | | | This can be null when accessed too early. Using the function-static global instance directly ensures initialization. There is more simplification potential in this area, but I'd leave that for master. Change-Id: Ide35f4119e9fbcb392d1abac180ef46c02c16b87 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* TextEditor: Move access to smaller settings chunkshjk2024-02-011-21/+2
| | | | | Change-Id: Id827edbd19dde54b66cb4349d9c832bc23110adc Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: Use new setup pattern for TextEditorSettings classhjk2024-01-291-0/+12
| | | | | Change-Id: I8980f21a3ea156d45ab68bad66b94fbc5bbad641 Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: Introduce a per-project variant of the comments settingsChristian Kandeler2023-08-081-2/+11
| | | | | | | | | | These settings can clearly differ per project. Note that the classes have to live in the ProjectExplorer plugin, which has a (questionable) dependency on TextEditor. Change-Id: I7e3816da30cecd1ccb66549a2226b44dc0a26cb4 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: Introduce dedicated comments settings pageChristian Kandeler2023-08-071-2/+4
| | | | | | | | We will soon add more comments settings. Change-Id: I91798b9d1071acefda70db523dcc72fdc2480cd7 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* Editor: avoid accessing the widget from the FontSettingsPageDavid Schulz2023-07-061-1/+0
| | | | | Change-Id: I51dbf4d1c7384f460b84da9602c10667addabebb Reviewed-by: hjk <hjk@qt.io>
* TextEditor: Add dedicated text style for C++ conceptsChristian Kandeler2023-06-201-0/+2
| | | | | | | | Fixes: QTCREATORBUG-29286 Change-Id: Ifc89bad0b84dfdbcac0720fc59799edd461c00bb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* TextEditor: Tr::trhjk2023-01-181-191/+189
| | | | | | Change-Id: I28aa68e25c53c3a4d1c370074d7b3318944dc45a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0, this applies only to a hypothetical newer version of GPL, that doesn't exist yet. If such a version emerges, we can still decide to relicense... While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only Change was done by running find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \; Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CppEditor: Do not highlight macros as preprocessor statementsChristian Kandeler2022-06-291-0/+2
| | | | | | | | | | Macros are used like identifiers; there is no reason why they should need to have the same highlighting as a preprocessor directive. Fixes: QTCREATORBUG-23548 Change-Id: I186befc06ccb36a00451fd707c41e3687a84af14 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: adjust default coco colors and controlsDavid Schulz2022-06-161-10/+21
| | | | | | Change-Id: I6fa4d5a65067d58e07be974e6ccc349030a03a53 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* TextEditor: fix typoDavid Schulz2022-06-131-1/+1
| | | | | Change-Id: Ibad6729f5281a1b7036af7483a82eae7e22649a5 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Display parent functions in the Find Usages menuIhor Ivlev2022-05-251-0/+5
| | | | | | | | | | | | | | | | To display the parent function, first we find it in displayResults and store the information to SearchResultItem, then SearchResultTreeItemDelegate gets the information and renders it. Similar approach is applied to ClangdClient, in addSearchResultsForFile. This change also adds default style for containing function highlight in the search. Default foreground and background colors are same as usual text colors. Task-number: QTCREATORBUG-27550 Change-Id: Id1251afa192f8d1232524742b7c211770bcb83fb Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Coco: long live the cocopluginDavid Schulz2022-05-061-0/+41
| | | | | | | | Change-Id: I1d21c67233d302a0689c4689bf9c2f349387ba1c Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: hjk <hjk@qt.io>
* TextEditor: Add highlighting category for namespacesChristian Kandeler2021-10-291-0/+2
| | | | | | | | ... and make use of it in the built-in code model and with clangd. Task-number: QTCREATORBUG-16580 Change-Id: I8c331f56aa1bbf91c9f768be82a779a72f40c4c7 Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: Allow special highlighting for static membersChristian Kandeler2021-10-281-0/+4
| | | | | | Task-number: QTCREATORBUG-9659 Change-Id: Idae529fd876ba5f555c76e4d282efc9263263d6c Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: remove Function from the declaration format UI textDavid Schulz2021-09-021-2/+2
| | | | | | Task-number: QTCREATORBUG-26156 Change-Id: I2ca0f8c6d6445a78b9bd5f366c51237073991fd6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge remote-tracking branch 'origin/4.15'Eike Ziller2021-03-221-2/+2
|\ | | | | | | | | | | | | | | Conflicts: src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp src/plugins/debugger/gdb/gdboptionspage.cpp Change-Id: I4149e860b6842ea63bff3a7eb9632b7a6c2919d8
| * Text Editor: Fix UI text capitalizationLeena Miettinen2021-03-181-2/+2
| | | | | | | | | | Change-Id: I888cfb4eb8c3b5934b45dcf80d751fb97d8f7624 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | ClangCodeModel/TextEditor: Add support for highlighting parametersTom Praschan2021-03-151-0/+2
|/ | | | | | | | | This is already built into clang, so we just need to expose it to the highlighter and the UI. Fixes: QTCREATORBUG-24880 Change-Id: I6d0595af2589a9b69eb954aafad46457ab2c5752 Reviewed-by: David Schulz <david.schulz@qt.io>
* Construct QColor instances from int instead of QStringJarek Kobus2020-11-171-4/+4
| | | | | Change-Id: I75c72d71fef024a2229f8f78a96d3f02a1fbf72b Reviewed-by: hjk <hjk@qt.io>
* Core: Allow different highlight colors in search result windowChristian Kandeler2020-09-181-0/+8
| | | | | | | | | ... and make use of that in CppTool's "Find Usages" by assigning different colors to read and write accesses. Fixes: QTCREATORBUG-12734 Change-Id: I067db2c8d693bb2c5be44249931ee4f0269f7e52 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Editor: set default text foreground color explicitDavid Schulz2020-07-201-1/+1
| | | | | | | | Amends 9182d4eda75033bbbebf50e87e518adc33d499f6. Fixes: QTCREATORBUG-24352 Change-Id: I16171874cf2f2e9fde95b404f7510a502a39f26e Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Core/Utils: Migrate further to Utils::Idhjk2020-07-061-16/+16
| | | | | | | | The coreplugin/id.h header is kept for downstream for now. Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66 (cherry picked from commit 430a33dcd9ac80ddb848e41f8f059102857c88aa) Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Git: Port colorful log to text colorsAndre Hartmann2020-07-061-1/+15
| | | | | | | | Fixes: QTCREATORBUG-24198 Change-Id: Icde06da5ac848fb0f7faf02a8e55fb26136f318c Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Editor: Fix crash on exitDavid Schulz2020-03-021-6/+11
| | | | | | | | | | | | Make sure no FontSettingsPageWidget is created when changing the font zoom level in the editor. Otherwise it will crash in the font combo box when closing Qt Creator. Since we can't use the save and emit mechanism from the widget anymore move it to TextEditorSettings Change-Id: I1eb87bbae3cf2b802fb15981e7fc2203106d5565 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* TextEditor: Drop some indirection of texteditor signallinghjk2020-02-041-14/+2
| | | | | | | | | | This is one of the few remaining users of the QObject inheritance of IOptionPage. While ok from an architectural point of view, this setup is not and has not been used elsewhere, and eats a few bytes and cycles. Change-Id: Id067f501d284d0726e8952345a2acd058dabbcd5 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: Move FontSettingsPage more towards new schemehjk2020-01-301-13/+10
| | | | | | | | | | | Mainly re-using the existing pimpl as new widget implementation, and using the primary storage out of the page (into texteditorsettings). This one is structutally bit different as there is that second path (Ctrl+Wheel) to modify font zoom. Change-Id: I7b85c781c7c53a733b234754beb5bb54664be3fd Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* TextEditor: Make FontSettingsPage more like the other oneshjk2020-01-271-27/+33
| | | | | Change-Id: I00d758bcdafd39b14498bdf182332ece53215d64 Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: Simplify BehaviorSettingsPage creationhjk2020-01-221-21/+14
| | | | | Change-Id: I0e1d44e9cccbf83e11ef04f055e1e6bd0317c40e Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* TextEditor: Simplify DisplaySettingsPage creationhjk2020-01-221-11/+5
| | | | | Change-Id: I082db19c8b88d1fa21690339d2cb7dc2728e0d44 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* TextEditor: Partially apply new settings page patternhjk2020-01-211-8/+3
| | | | | | | | Internal handling is quite fragile in some cases, so take baby steps here. Change-Id: Ia25666b8c8d26b6e580d2189b191767b9681dc21 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* TextEditor: Partially apply SettingsPage pattern to completion settingshjk2020-01-201-8/+3
| | | | | Change-Id: Ieb8547bab74c6a2d6489a6bf53b7f224003e0401 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* FancyLineEdit: Add camel case navigationAndre Hartmann2019-08-021-0/+8
| | | | | | | | | | | | Use it for search and replace functions as well as for Locator. The camel case navigation can be switched on / off with the existing menu Options > Text Editor > Behavior > Enable Build-in camel case navigation. Fixes: QTCREATORBUG-21140 Change-Id: I3f2dcafff231366b3c8f08c14514dd8940cca2a0 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Compile fix with recent Qt devhjk2019-07-291-1/+1
| | | | | | | | | The reasoning in 1b4766e26c6b did not take into account that the scope of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with f70905448f6 in Qt base. Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* General Messages Pane: Add font settings and zoomAndre Hartmann2019-03-201-0/+14
| | | | | | | | | | As the settings are managed by TextEditor, but Core does not depend on TextEditor, no signal connection can be used. Instead, call the needed functions in MessageManager directly. Fixes: QTCREATORBUG-18908 Change-Id: Idc81f1071d5228cd6582e3a00189a5db24288fc6 Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: replace generic highlighter with ksyntaxhighlightingDavid Schulz2019-01-281-9/+10
| | | | | | Fixes: QTCREATORBUG-21029 Change-Id: I9894c4384e0e47da6bf030b7b8e07c3ad4737ff3 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* TextEditor: Remove defaults from FormatMarco Bubke2018-10-111-6/+6
| | | | | | | | | The default caused strange bugs because it was expected that no color was set. Task-number: QTCREATORBUG-21282 Change-Id: I3b520b944ffcb87838ba3e7b02e1d28b0f757679 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* TextEditor: Handle overloaded operators as functionsMarco Bubke2018-09-261-3/+4
| | | | | | | | | | Overloaded operators are semantically very similar to functions. So it make sense to highlight them the same. It provides the user also with feedback that he can jump to the declaration of the operator etc.. Change-Id: I110084e3e53882c9d5cbfa88442a93914792db17 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* TextEditor: Cleanup text stylesMarco Bubke2018-09-251-20/+23
| | | | | | | | | | | | | So far there were different settings for different mix-ins. There was no technical reason why we limit the user. So you can set now the color, the relative saturation and value, the font, underline, italic and bold. The relative saturation and value are disabled if the color is set. The settings are reordered too so the order reflects the semantic meaning much better. Change-Id: I440967d6729f720816d2bc028ff9fe8e8868074e Task-number: QTCREATORBUG-21105 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* TextEditor: ModernizeOrgad Shaneh2018-09-201-5/+5
| | | | | | | override, auto, nullptr, member initializers. Change-Id: I04c6ebb683849568973bd7782fb5a3279267141e Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Highlighting: Add highlighting style for punctuationIvan Donchevskii2018-09-131-5/+8
| | | | | | | | | Currently only operators have their own style but not punctuation tokens. Make possible to highlight both. Task-number: QTCREATORBUG-20666 Change-Id: I9533e0f1bef65b86c4e4f5c9756571103584124b Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* TextEditor: Highlight punctuators as TextHugo Holgersson2018-05-031-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change limits the set of tokens that fall under Token::isOperator(). That allows cpphighlighter.cpp to distinguish operator tokens from punctuator tokens (without changing any logic in cpphighlighter.cpp). This change moves punctuators from "Operator" to the "Text" style category where they belong. Punctuators are not operators. Punctuators are dumb text tokens. Why don't we let the clang backend alone separate these tokens for us? 1. Clang is slow on big files. Sometimes the highlighting dictated by clang is painted _seconds_ after cpphighlighter.cpp runs. CppHighlighter is way faster so we use it to "prepaint" code while clang is busy in the background. 2. Secondly, clang cannot yet handle all operator types. In particular, none if its "operator cursors" CXCursor_UnaryOperator: CXCursor_BinaryOperator: CXCursor_CompoundAssignOperator: CXCursor_ConditionalOperator: includes the -> and . operators. We still need CppHighlighter to paint those tokens. However, once clang has finished processing the file some operator tokens will be repainted. We need clang to get all operators' semantics. In particular, we need clang to tell us if < is a "smaller than"-operator or part of a template parameter like set<int>. Task-number: QTCREATORBUG-19659 Change-Id: I952cb58f7c79134b3281e2a8221425cc1d0ad263 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Clang: Add semantic C++ operator-token stylingHugo Holgersson2018-04-301-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | We used to style overloaded operators in the same way as C++'s built-in operators. There was no way to tell if a + token would call a operator+() function or not. Now, if an operator is overloaded (redefined), we give it the "Overloaded Operator"-mixin so users can style it differently. Note: Calls to overloaded 'new' and 'delete' are not highlighted by "Overloaded Operator". This is because clang today always maps these to CXCursor_CXXNewExpr and CXCursor_CXXDeleteExpr with cursor.spelling == "" (empty string). So there is no (?) quick way for us to tell if a new/delete-token was overloaded or not. After follow-ups, follow symbol will work for operator overload usages in current translation unit. Commit is appended by Ivan Donchevskii. Task-number: QTCREATORBUG-19659 Change-Id: I157855d482a61ad2059642a1ee982089fcb7d312 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* TextEditor: Do not try to remove settings pages from global object poolhjk2018-03-051-7/+0
| | | | | | | | | They are not present there anymore. This amends 928dd20101f7a6ee4d40b320b25a60a52fbba228. Change-Id: I383511dfc7c8da9a6c594e44a4ec697a2057ef9c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* TextEditor: Do not put settings pages into global object poolhjk2018-03-021-8/+0
| | | | | | | No need for it. Change-Id: I401f8c2894c74f331311f0025df29972142739c9 Reviewed-by: David Schulz <david.schulz@qt.io>