Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
8cc916a0
Commit
8cc916a0
authored
Jul 14, 2009
by
Thorbjørn Lindeijer
Browse files
Added categories for occurrences and for renaming occurrences
So they can be adapted in the color schemes.
parent
12911cda
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/plugins/cppeditor/cppeditor.cpp
View file @
8cc916a0
...
...
@@ -841,7 +841,7 @@ void CPPEditor::renameInPlace()
if
(
c
.
position
()
>=
s
.
cursor
.
anchor
()
&&
c
.
position
()
<=
s
.
cursor
.
position
())
{
m_currentRenameSelection
=
i
;
m_renameSelections
[
i
].
format
.
setBackground
(
QColor
(
255
,
200
,
200
))
;
m_renameSelections
[
i
].
format
=
m_occurrenceRenameFormat
;
setExtraSelections
(
CodeSemanticsSelection
,
m_renameSelections
);
break
;
}
...
...
@@ -1566,6 +1566,8 @@ void CPPEditor::setFontSettings(const TextEditor::FontSettings &fs)
highlighter
->
rehighlight
();
m_linkFormat
=
fs
.
toTextCharFormat
(
QLatin1String
(
TextEditor
::
Constants
::
C_LINK
));
m_occurrencesFormat
=
fs
.
toTextCharFormat
(
QLatin1String
(
TextEditor
::
Constants
::
C_OCCURRENCES
));
m_occurrenceRenameFormat
=
fs
.
toTextCharFormat
(
QLatin1String
(
TextEditor
::
Constants
::
C_OCCURRENCES_RENAME
));
}
void
CPPEditor
::
setDisplaySettings
(
const
TextEditor
::
DisplaySettings
&
ds
)
...
...
@@ -1632,9 +1634,6 @@ void CPPEditor::updateSemanticInfo(const SemanticInfo &semanticInfo)
int
line
=
0
,
column
=
0
;
convertPosition
(
position
(),
&
line
,
&
column
);
QTextCharFormat
format
;
format
.
setBackground
(
QColor
(
220
,
220
,
220
));
QList
<
QTextEdit
::
ExtraSelection
>
selections
;
SemanticInfo
::
LocalUseIterator
it
(
semanticInfo
.
localUses
);
...
...
@@ -1655,7 +1654,7 @@ void CPPEditor::updateSemanticInfo(const SemanticInfo &semanticInfo)
if
(
!
good
)
continue
;
highlightUses
(
document
(),
f
ormat
,
uses
,
&
selections
);
highlightUses
(
document
(),
m_occurrencesF
ormat
,
uses
,
&
selections
);
break
;
// done
}
...
...
src/plugins/cppeditor/cppeditor.h
View file @
8cc916a0
...
...
@@ -301,6 +301,8 @@ private:
QAction
*
m_sortAction
;
QTimer
*
m_updateMethodBoxTimer
;
QTimer
*
m_updateUsesTimer
;
QTextCharFormat
m_occurrencesFormat
;
QTextCharFormat
m_occurrenceRenameFormat
;
QList
<
QTextEdit
::
ExtraSelection
>
m_renameSelections
;
int
m_currentRenameSelection
;
...
...
src/plugins/texteditor/fontsettingspage.cpp
View file @
8cc916a0
...
...
@@ -190,6 +190,10 @@ QColor FormatDescription::background() const
}
else
if
(
m_name
==
QLatin1String
(
Constants
::
C_SELECTION
))
{
const
QPalette
palette
=
QApplication
::
palette
();
return
palette
.
color
(
QPalette
::
Highlight
);
}
else
if
(
m_name
==
QLatin1String
(
Constants
::
C_OCCURRENCES
))
{
return
QColor
(
220
,
220
,
220
);
}
else
if
(
m_name
==
QLatin1String
(
Constants
::
C_OCCURRENCES_RENAME
))
{
return
QColor
(
255
,
200
,
200
);
}
return
QColor
();
// invalid color
}
...
...
src/plugins/texteditor/texteditorconstants.h
View file @
8cc916a0
...
...
@@ -77,6 +77,8 @@ const char * const C_SEARCH_SCOPE = "SearchScope";
const
char
*
const
C_PARENTHESES
=
"Parentheses"
;
const
char
*
const
C_CURRENT_LINE
=
"CurrentLine"
;
const
char
*
const
C_CURRENT_LINE_NUMBER
=
"CurrentLineNumber"
;
const
char
*
const
C_OCCURRENCES
=
"Occurrences"
;
const
char
*
const
C_OCCURRENCES_RENAME
=
"Occurrences.Rename"
;
const
char
*
const
C_NUMBER
=
"Number"
;
const
char
*
const
C_STRING
=
"String"
;
...
...
src/plugins/texteditor/texteditorsettings.cpp
View file @
8cc916a0
...
...
@@ -77,6 +77,9 @@ TextEditorSettings::TextEditorSettings(QObject *parent)
currentLineNumber
.
format
().
setBold
(
true
);
formatDescriptions
.
append
(
currentLineNumber
);
formatDescriptions
.
append
(
FormatDescription
(
QLatin1String
(
C_OCCURRENCES
),
tr
(
"Occurrences"
)));
formatDescriptions
.
append
(
FormatDescription
(
QLatin1String
(
C_OCCURRENCES_RENAME
),
tr
(
"Renaming Occurrence"
)));
// Standard categories
formatDescriptions
.
append
(
FormatDescription
(
QLatin1String
(
C_NUMBER
),
tr
(
"Number"
),
Qt
::
darkBlue
));
formatDescriptions
.
append
(
FormatDescription
(
QLatin1String
(
C_STRING
),
tr
(
"String"
),
Qt
::
darkGreen
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment