Commit Graph

97 Commits

Author SHA1 Message Date
Artem Sokolovskii
66f132dd9b TextEditor: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: Ie9594bf661dbeecf22589c1580648252f0bfb7fb
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-05-19 07:33:27 +00:00
Christian Kandeler
c3a1193969 TextEditor: Add highlighting category for namespaces
... 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>
2021-10-29 08:36:20 +00:00
Orgad Shaneh
3871e40f43 Fix qHash-related size compatibility warnings by MSVC
Change-Id: I3b7981ce78b67db4b996f99682284a0b911d8cd7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-10-20 15:03:51 +00:00
hjk
8e352af0ec Core: Add a default parameter to various ICore::*path functions
Saves some code on the user side.

Change-Id: I32cd220b6e533f5497a1865f9c34ab9db4cfda79
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-04-27 06:52:05 +00:00
Eike Ziller
c1f90aeca2 ICore: Change some path API to use FilePath
Change-Id: Id841d6177206a021c9e606ce560b47d1ae6e52b9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-04-26 08:03:47 +00:00
David Schulz
f220cb0e23 Revert "Editor: Make line spacing adjustable"
This does not work with text wrapping since there are multiple
QTextLines inside a block but we can not adjust the line hight inside a
block. This needs to be addressed inside Qt.

This reverts commit dc64f3207b.

Change-Id: If6c28056da9891eeeb75f5939a42f08360013a80
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-20 04:35:42 +00:00
David Schulz
dc64f3207b Editor: Make line spacing adjustable
Fixes: QTCREATORBUG-13727
Change-Id: I3dbc3277795b339bced81dc6c5a048c828183cb6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-01 12:11:09 +00:00
Christian Kandeler
4376bc1e39 Core: Allow different highlight colors in search result window
... 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>
2020-09-18 09:33:07 +00:00
Eike Ziller
5b364de168 Use dialogParent() instead of mainWindow()
There are very few reasons to use mainWindow() directly.
Especially for modal dialogs, using dialogParent() is important, since
that guarantees the stacking order in case of other dialogs currently
being open.

Change-Id: I7ad2c23c5034b43195eb35cfe405932a7ea003e6
Reviewed-by: hjk <hjk@qt.io>
2020-06-02 11:44:53 +00:00
hjk
f8ee2d3c40 TextEditor: Move FontSettingsPage more towards new scheme
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>
2020-01-30 10:14:16 +00:00
David Schulz
bcda567392 TextEditor: skip painting overlays with invalid background
Makes it possible to turn of specific overlays by unsetting the color.
Such color resulted in a black overlay until now, which is also kind of
unexpected.

Change-Id: I90732ae496af62b573b2e3b8d8c7fe56632ca8d9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-01-24 05:37:31 +00:00
Eike Ziller
f1e929f0e7 Color schemes: Fix wrong colors for unset values
Defaulting to C_TEXT in that case is correct, but the values
for C_TEXT are set via the palette, so other display features like
the current line highlighting and the block visualization,
which are painted _below_ the text, are not overridden.

So, the correct way for a style to set the same foreground and
background colors as C_TEXT, is to leave these colors unset.

Fixes: QTCREATORBUG-21661
Change-Id: I8cdb73e8edc5e3883e1ef107bd1c2b29e6d75b9c
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-12-10 14:18:42 +00:00
Marco Bubke
425463ce8d TextEditor: Fix highlighting for mixins
The color from mix-ins should be always override the previous color. It
should only be tested for relative colors. It looks like the branches was
mixed up.

Change-Id: I9b8602ab65cab65f0df8ec2c111845cf2d8d33cf
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-09-13 12:10:58 +00:00
Hugo Holgersson
3192366b44 TextEditor: Implement color overriding mixins
This is the first implementation of "color overriding mixins".

Mixins are already initialized with fore/background color =
QColor() = "invalid color" (see Format::createMixinFormat).

This patch uses above contract in FontSettings::addMixinStyle.
Only mixins with a valid fore- or background color can override
other style options' colors. Unset mixins will have no effect.

TEST=No functional change (will be enabled in a follow-up).

Requires Clang.

Task-number: QTCREATORBUG-16625
Change-Id: I983bb876c060963f6d66cc64881bc138e384f5e5
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-19 21:04:00 +00:00
Ivan Donchevskii
8679d8e9a9 TextEditor: fix underlined text Bg color
Set default bg color to NoBrush.
Previously caused incorrect painting when
underline style was set without background.

Task-number: QTCREATORBUG-18101
Change-Id: I4c1d86a3c711a3962e01ccf3a937dafa36b68ec2
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-05-17 11:51:47 +00:00
David Schulz
c8215d4b6e Editor: Fix search result backgound for declarations
Don't add a background to a format without a background
if a mixin is applied.

Task-number: QTCREATORBUG-17314
Change-Id: Ie76fe7f69e98e9cfdfa290c40f0774dbe6f86cea
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2016-12-05 12:26:06 +00:00
Marco Bubke
e24eb97969 TextEditor: Relative colors
We introduce relative colors to make it possible to change for
example the color of a declaration slightly.

Change-Id: I8c1991a8907207d3616be954504c68ea18c6deb1
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-09-28 09:10:35 +00:00
Alessandro Portale
9ab6228ba0 Use "Source Code Pro" as default editor font on non-macOS
Change-Id: Ie0e8e9de8d2f3761ba033d139c74edab13534e3d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-22 11:11:24 +00:00
Orgad Shaneh
edc77e339f TextEditor: Default to Text style on style absence (take 2)
The current default is black foreground, which is invisible on dark
color schemes.

Change-Id: Iaa2520422ea6a6b355c89d71d204a7620aa98fcd
(cherry picked from commit 2c3f3970d5)
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-20 11:58:02 +00:00
Orgad Shaneh
ac931e19d5 TextEditor: Improve default color mechanism in FormatDescription
Required for providing defaults for non-existent entries that should
fall-back to text.

Change-Id: I8ce33257a55cf173a5e9b904b7da6326163b4261
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-20 11:57:57 +00:00
Orgad Shaneh
9577eb72b4 TextEditor: Minor cleanup in FontSettings
Change-Id: Ib12e2ea2c1afc9a32d7d21636bc8097497fb74b1
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-20 11:57:54 +00:00
Marco Bubke
a823caa396 TextEditor: Improve speed of hash function for font settings
The size of the array is fixed so we can simply use the memory patter as
a hash value.

Change-Id: If86a58b111a07b2bd9cecc12a03d74b93a914159
Task-number: QTCREATORBUG-16419
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-10 06:27:19 +00:00
Orgad Shaneh
47295d267f FontSettings: Change argument to be const-reference
Change-Id: I8fb22db04692e245819c8b4c778b31e127f1880e
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-03-09 09:01:05 +00:00
Marco Bubke
36e0025d6e TextEditor: Fix mixin font settings
We don't clear the cache so that changes in the font settings are not
reflected in the editor.

Change-Id: I9d54992d0770b42e1055e99d9e8a2866dd698672
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-03-03 14:53:18 +00:00
Christian Stenger
466bf485b0 TextEditor: Fix compile on OSX
Change-Id: I0ed48bc18489a59b0205f56a89b84e9e21fe29ca
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-02-23 13:41:54 +00:00
Christian Stenger
a73c824083 TextEditor: Fix compile for Qt < 5.5
Change-Id: I653d76452289a91fdb069be14dd2c8816f856306
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-02-23 11:45:06 +00:00
Marco Bubke
b21b5bb2ae TextEditor: Add mixins for font settings
You can only set one text style but in many cases like
Function and Declaration it would be nice if they could be merged.

Change-Id: Icda892057b79eef1bea2fa8b2c5f0f7cbc5f518a
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-02-23 08:44:07 +00:00
Alessandro Portale
2ff75813b2 TextEditor: Define Color Scheme entry per Theme
The TextEditor settings do not remember a global Color Scheme setting,
anymore, but rather a Color Scheme ber Theme. A .creatortheme can define
a default TextEditor Color Scheme (overridable in the settings). This
makes switching of schemes more pleasant.

Taks-number: QTCREATORBUG-15229
Change-Id: I3bd36a4dfa23feea2254be2df50fce064e8fe2af
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-01-29 08:22:38 +00:00
Alessandro Portale
126d1b0811 TextEditor: Remove obsolete "customized.xml" feature
In case the qtcreator.ini has a TextEditor section without a defined
ColorScheme value, Qt Creator decides to create a new "styles/customized
%i.xml" and select that as scheme.
I assume that this was implemented way back then, as migration code when
selectable Color Schemes were introduced. These days, it makes
maintenance (and implementation of QTCREATORBUG-15229) more difficult.
Let's remove it.

Task-number: QTCREATORBUG-15649
Change-Id: I49102d02fa8e582a92f6e39faa8c7d3b58f531b3
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-01-26 09:25:42 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Marco Bubke
331e9d8878 TextEdit: Add underline support to text settings
Underlines colors was hard coded to the foreground color of some settings.
With this patch you can set the underline color and the underline style
to your taste.

Change-Id: Ibc64c2d2c89bf1827a2cadaf6aee9d50d08cd1ee
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-09-10 13:40:04 +00:00
Marco Bubke
0d20d56183 TextEditor/Clang: Add font settings for clang diagnostics
Change-Id: Iea2b4fabf0f4620b12f88b108eb59c160945c8d8
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-09-10 13:39:43 +00:00
Marco Bubke
b278dc87ca Clang: Add diagnostics
Diagnostics are now moved to the clang backend process. Fixits are
supported too.

Change-Id: I20faacf466bbf78dec479220c3d7b336a47bc453
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-31 14:59:16 +00:00
David Schulz
f34b32abd5 Editor: Make parenthese mismatch color configurable.
Task-number: QTCREATORBUG-14357
Change-Id: I92a0d50fb8f3448195f3d38f7544a31eb695733b
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-05-18 12:18:17 +00:00
Eike Ziller
9926fc2ab1 Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'
Conflicts:
	src/libs/utils/tooltip/tipcontents.cpp
	src/libs/utils/tooltip/tipcontents.h
	src/plugins/android/androiddeployqtstep.cpp
	src/plugins/baremetal/baremetalconstants.h
	src/plugins/baremetal/baremetaldevice.cpp
	src/plugins/baremetal/baremetaldevice.h
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.h
	src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h
	src/plugins/baremetal/baremetalplugin.cpp
	src/plugins/baremetal/baremetalplugin.h
	src/plugins/baremetal/baremetalruncontrolfactory.cpp
	src/plugins/baremetal/baremetalruncontrolfactory.h
	src/plugins/cppeditor/cppcodemodelinspectordialog.cpp
	src/plugins/cppeditor/cppdoxygen_test.cpp
	src/plugins/cppeditor/cppdoxygen_test.h
	src/plugins/debugger/breakpointmarker.cpp
	src/plugins/debugger/debuggeritemmodel.cpp
	src/plugins/debugger/debuggeritemmodel.h
	src/plugins/debugger/loadcoredialog.cpp
	src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp
	src/plugins/projectexplorer/addnewmodel.cpp
	src/plugins/projectexplorer/addnewmodel.h
	src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.h
	src/plugins/qmlprofiler/notesmodel.cpp
	src/plugins/qmlprofiler/qml/CategoryLabel.qml
	src/plugins/qmlprofiler/qml/MainView.qml
	src/plugins/qmlprofiler/qml/Overview.js
	src/plugins/qmlprofiler/qml/Overview.qml
	src/plugins/qmlprofiler/qml/TimeDisplay.qml
	src/plugins/qmlprofiler/qml/TimeMarks.qml
	src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.h
	src/plugins/qmlprofiler/timelinemodelaggregator.cpp
	src/plugins/qmlprofiler/timelinemodelaggregator.h
	src/plugins/qmlprofiler/timelinerenderer.cpp
	src/plugins/qmlprofiler/timelinerenderer.h
	src/plugins/qmlprojectmanager/QmlProjectManager.json.in
	src/plugins/texteditor/findinfiles.cpp
	src/plugins/vcsbase/vcsconfigurationpage.cpp
	src/shared/qbs
	src/shared/scriptwrapper/interface_wrap_helpers.h
	src/shared/scriptwrapper/wrap_helpers.h
	tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp
	tests/system/suite_debugger/tst_debug_empty_main/test.py
	tests/system/suite_debugger/tst_qml_js_console/test.py
	tests/system/suite_debugger/tst_qml_locals/test.py

Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
2015-02-12 17:29:21 +01:00
Orgad Shaneh
8b5dcc13c5 Replace QFileInfo::fileName() with FileName::fileName()
Change-Id: I4852ff215abf25649fc5eac1e922ae901839ca3d
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-01-29 11:15:43 +00:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00
Eike Ziller
8295b503be License update
Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-09 11:41:44 +02:00
Eike Ziller
b53e275ee6 TextEditors: use antialias setting in preview and app-/compile output
Change-Id: I992f6626881bccf432e36fc7fbdf646608218213
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-02-06 15:17:26 +01:00
Eike Ziller
c99464dd9b TextEditors: Remove unnecessary duplicated caching
Change-Id: I3800360e3b9bd6874d6852dabcfc7a9a066e52c2
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-24 08:00:28 +01:00
Eike Ziller
13ee70652c FontSettings: Globally cache textcharformats
Change-Id: I02ca646322b07eeb21c2cdd4ef5594b754234e12
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-24 08:00:18 +01:00
Robert Loehning
746c5d8863 Incremented year in copyright info
Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-01-08 08:29:47 +01:00
Friedemann Kleint
3a806d4252 Clean headers in TextEditor.
Change-Id: Ie679e7e9d0d20a0f71dcc1fcf0f7d8305eeeeced
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2013-03-27 07:15:31 +01:00
Christian Kandeler
cb9ac60609 TextEditor: Minimize use of ifdefs.
Change-Id: Icc924fda429032d8806caac66230c6fc55b96c53
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-03-18 10:58:26 +01:00
Oswald Buddenhagen
1fda2111d4 Merge remote-tracking branch 'origin/2.6'
Conflicts:
	src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in
	src/plugins/debugger/qtmessageloghandler.cpp
	src/plugins/debugger/qtmessagelogwindow.cpp
	src/plugins/madde/maemodeployconfigurationwidget.cpp
	src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp
	src/plugins/qmldesigner/designercore/include/widgetqueryview.h
	src/plugins/qmldesigner/designercore/metainfo/metainfoparser.cpp
	src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.cpp
	src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.h
	src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp
	src/plugins/qnx/bardescriptormagicmatcher.h
	src/plugins/qt4projectmanager/profilekeywords.cpp
	src/plugins/remotelinux/deployablefilesperprofile.cpp
	src/plugins/remotelinux/deployablefilesperprofile.h
	src/plugins/remotelinux/deploymentinfo.cpp
	src/plugins/remotelinux/deploymentsettingsassistant.cpp
	src/plugins/remotelinux/profilesupdatedialog.cpp
	tests/auto/icheckbuild/ichecklib.cpp
	tests/auto/icheckbuild/parsemanager.cpp
	tests/auto/icheckbuild/parsemanager.h

Change-Id: Ie465a578446a089e1c502d1cb1096e84ca058104
2013-01-31 16:25:33 +01:00
Robert Loehning
298531e370 Incremented year in copyright info
Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-29 16:27:03 +01:00
Orgad Shaneh
f0ef96ef0c Replace some const char * with const char[]
Change-Id: I7657792d9ebfcaede7b719400d239f837074290b
Reviewed-by: David Schulz <david.schulz@digia.com>
2012-11-22 09:36:09 +01:00
Orgad Shaneh
7fa69afa6c Use Core::Id for language
Change-Id: I0077558e9e2cf5aa06ac921cb45224e29aa85c9b
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-22 08:32:44 +01:00
David Schulz
f06ff7b100 Find: Add text editor color scheme to search result
Task-number: QTCREATORBUG-8070

Change-Id: Ic220e3364aa9a5227518a210dbf0590deb06a4d6
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2012-11-13 21:05:12 +01:00
hjk
386ca7c8dd Adjust license headers
Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2012-10-05 17:12:56 +02:00