Utils: Move code model icons to utils
Using the already established icons for code model errors and warnings to Utils to mak them accessible for other code models. Change-Id: If9f8efde60cf20411e043aeb2831a9254398bcaf Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
|
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 152 B |
|
Before Width: | Height: | Size: 205 B After Width: | Height: | Size: 205 B |
|
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 158 B |
|
Before Width: | Height: | Size: 249 B After Width: | Height: | Size: 249 B |
@@ -184,5 +184,9 @@
|
||||
<file>images/select@2x.png</file>
|
||||
<file>images/app-on-top.png</file>
|
||||
<file>images/app-on-top@2x.png</file>
|
||||
<file>images/codemodelerror.png</file>
|
||||
<file>images/codemodelerror@2x.png</file>
|
||||
<file>images/codemodelwarning.png</file>
|
||||
<file>images/codemodelwarning@2x.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -233,5 +233,14 @@ const Icon OVERLAY_ERROR({
|
||||
{":/utils/images/iconoverlay_error_background.png", Theme::BackgroundColorNormal},
|
||||
{":/utils/images/iconoverlay_error.png", Theme::IconsErrorColor}}, Icon::Tint);
|
||||
|
||||
const Icon CODEMODEL_ERROR({
|
||||
{":/utils/images/codemodelerror.png", Theme::IconsErrorColor}}, Icon::Tint);
|
||||
const Icon CODEMODEL_WARNING({
|
||||
{":/utils/images/codemodelwarning.png", Theme::IconsWarningColor}}, Icon::Tint);
|
||||
const Icon CODEMODEL_DISABLED_ERROR({
|
||||
{":/utils/images/codemodelerror.png", Theme::IconsDisabledColor}}, Icon::Tint);
|
||||
const Icon CODEMODEL_DISABLED_WARNING({
|
||||
{":/utils/images/codemodelwarning.png", Theme::IconsDisabledColor}}, Icon::Tint);
|
||||
|
||||
} // namespace Icons
|
||||
} // namespace Utils
|
||||
|
||||
@@ -133,5 +133,10 @@ QTCREATOR_UTILS_EXPORT extern const Icon OVERLAY_ADD;
|
||||
QTCREATOR_UTILS_EXPORT extern const Icon OVERLAY_WARNING;
|
||||
QTCREATOR_UTILS_EXPORT extern const Icon OVERLAY_ERROR;
|
||||
|
||||
QTCREATOR_UTILS_EXPORT extern const Icon CODEMODEL_ERROR;
|
||||
QTCREATOR_UTILS_EXPORT extern const Icon CODEMODEL_WARNING;
|
||||
QTCREATOR_UTILS_EXPORT extern const Icon CODEMODEL_DISABLED_ERROR;
|
||||
QTCREATOR_UTILS_EXPORT extern const Icon CODEMODEL_DISABLED_WARNING;
|
||||
|
||||
} // namespace Icons
|
||||
} // namespace Utils
|
||||
|
||||
@@ -75,9 +75,6 @@ HEADERS += \
|
||||
|
||||
FORMS += clangprojectsettingswidget.ui
|
||||
|
||||
RESOURCES += \
|
||||
clangcodemodel.qrc
|
||||
|
||||
DISTFILES += \
|
||||
README \
|
||||
$${IDE_SOURCE_TREE}/doc/src/editors/creator-clang-codemodel.qdoc
|
||||
|
||||
@@ -51,7 +51,6 @@ QtcPlugin {
|
||||
"clangbackendsender.h",
|
||||
"clangcodemodelplugin.cpp",
|
||||
"clangcodemodelplugin.h",
|
||||
"clangcodemodel.qrc",
|
||||
"clangcompletionassistinterface.cpp",
|
||||
"clangcompletionassistinterface.h",
|
||||
"clangcompletionassistprocessor.cpp",
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<RCC>
|
||||
<qresource prefix="/clangcodemodel">
|
||||
<file>images/error.png</file>
|
||||
<file>images/error@2x.png</file>
|
||||
<file>images/warning.png</file>
|
||||
<file>images/warning@2x.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "clangconstants.h"
|
||||
#include "clangdiagnostictooltipwidget.h"
|
||||
|
||||
#include <utils/icon.h>
|
||||
#include <utils/utilsicons.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/theme/theme.h>
|
||||
|
||||
@@ -86,23 +86,11 @@ ClangTextMark::ClangTextMark(const QString &fileName,
|
||||
|
||||
void ClangTextMark::updateIcon(bool valid)
|
||||
{
|
||||
static const QIcon errorIcon = Utils::Icon(
|
||||
{{":/clangcodemodel/images/error.png", Utils::Theme::IconsErrorColor}},
|
||||
Utils::Icon::Tint).icon();
|
||||
static const QIcon warningIcon = Utils::Icon(
|
||||
{{":/clangcodemodel/images/warning.png", Utils::Theme::IconsWarningColor}},
|
||||
Utils::Icon::Tint).icon();
|
||||
static const QIcon invalidErrorIcon = Utils::Icon(
|
||||
{{":/clangcodemodel/images/error.png", Utils::Theme::IconsDisabledColor}},
|
||||
Utils::Icon::Tint).icon();
|
||||
static const QIcon invalidWarningIcon = Utils::Icon(
|
||||
{{":/clangcodemodel/images/warning.png", Utils::Theme::IconsDisabledColor}},
|
||||
Utils::Icon::Tint).icon();
|
||||
|
||||
using namespace Utils::Icons;
|
||||
if (isWarningOrNote(m_diagnostic.severity()))
|
||||
setIcon(valid ? warningIcon : invalidWarningIcon);
|
||||
setIcon(valid ? CODEMODEL_WARNING.icon() : CODEMODEL_DISABLED_WARNING.icon());
|
||||
else
|
||||
setIcon(valid ? errorIcon : invalidErrorIcon);
|
||||
setIcon(valid ? CODEMODEL_ERROR.icon() : CODEMODEL_DISABLED_ERROR.icon());
|
||||
}
|
||||
|
||||
bool ClangTextMark::addToolTipContent(QLayout *target) const
|
||||
|
||||
@@ -6429,7 +6429,7 @@
|
||||
</g>
|
||||
<g
|
||||
style="display:inline"
|
||||
id="src/plugins/clangcodemodel/images/warning"
|
||||
id="src/libs/utils/images/codemodelwarning"
|
||||
transform="translate(-373,-48)">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:none"
|
||||
@@ -6455,7 +6455,7 @@
|
||||
</g>
|
||||
<g
|
||||
style="display:inline"
|
||||
id="src/plugins/clangcodemodel/images/error"
|
||||
id="src/libs/utils/images/codemodelerror"
|
||||
transform="translate(-374,-48)">
|
||||
<use
|
||||
height="600"
|
||||
|
||||
|
Before Width: | Height: | Size: 316 KiB After Width: | Height: | Size: 316 KiB |