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
Utilities
Kate
Commits
cdfdaefb
Commit
cdfdaefb
authored
Feb 05, 2022
by
Waqar Ahmed
Committed by
Christoph Cullmann
Feb 05, 2022
Browse files
Dim the path color slightly to make the filename standout more
parent
5d2c5652
Pipeline
#133612
passed with stage
in 2 minutes and 25 seconds
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
addons/search/MatchModel.cpp
View file @
cdfdaefb
...
...
@@ -554,7 +554,19 @@ QString MatchModel::fileToHtmlString(const MatchFile &matchFile) const
}
path
=
path
.
toHtmlEscaped
();
path
.
remove
(
m_resultBaseDir
);
QString
tmpStr
=
QStringLiteral
(
"%1<b>%2: %3</b>"
).
arg
(
path
,
matchFile
.
fileUrl
.
fileName
().
toHtmlEscaped
()).
arg
(
matchFile
.
matches
.
size
());
// dim the path color slightly
const
auto
fgColor
=
QColor
(
m_foregroundColor
);
QString
fg
;
if
(
fgColor
.
lightness
()
<
127
)
{
fg
=
fgColor
.
lighter
(
150
).
name
();
}
else
{
fg
=
fgColor
.
darker
(
150
).
name
();
}
QString
tmpStr
=
QStringLiteral
(
"<span style=
\"
color:%1;
\"
>%2</span><b>%3: %4</b>"
)
.
arg
(
fg
)
.
arg
(
path
)
.
arg
(
matchFile
.
fileUrl
.
fileName
().
toHtmlEscaped
())
.
arg
(
matchFile
.
matches
.
size
());
return
tmpStr
;
}
...
...
addons/search/htmldelegate.cpp
View file @
cdfdaefb
...
...
@@ -47,7 +47,7 @@ SPHtmlDelegate::SPHtmlDelegate(QObject *parent)
static
int
lineNumAreaWidth
(
const
QModelIndex
&
index
,
const
QFontMetrics
&
fm
)
{
const
auto
lastRangeForFile
=
index
.
parent
().
data
(
MatchModel
::
LastMatchedRangeInFile
).
value
<
KTextEditor
::
Range
>
();
const
QString
lineCol
=
QStringLiteral
(
"%1:%2"
).
arg
(
lastRangeForFile
.
start
().
line
()).
arg
(
lastRangeForFile
.
start
().
column
());
const
QString
lineCol
=
QStringLiteral
(
"%1:%2"
).
arg
(
lastRangeForFile
.
start
().
line
()
+
1
).
arg
(
lastRangeForFile
.
start
().
column
()
+
1
);
return
fm
.
horizontalAdvance
(
lineCol
);
}
...
...
Write
Preview
Markdown
is supported
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