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
Marco Bubke
flatpak-qt-creator
Commits
e0572239
Commit
e0572239
authored
Feb 25, 2010
by
mae
Browse files
Fixed: Search scope is hidden by block highlighting
Task-number: QTCREATORBUG-758 Reviewed-by: thorbjorn
parent
912a1b95
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/texteditor/basetexteditor.cpp
View file @
e0572239
...
...
@@ -2337,6 +2337,50 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
QAbstractTextDocumentLayout
::
PaintContext
context
=
getPaintContext
();
if
(
!
d
->
m_highlightBlocksInfo
.
isEmpty
())
{
// extra pass for the block highlight
const
int
margin
=
5
;
QTextBlock
blockFP
=
block
;
QPointF
offsetFP
=
offset
;
while
(
blockFP
.
isValid
())
{
QRectF
r
=
blockBoundingRect
(
blockFP
).
translated
(
offsetFP
);
int
n
=
blockFP
.
blockNumber
();
int
depth
=
0
;
foreach
(
int
i
,
d
->
m_highlightBlocksInfo
.
open
)
if
(
n
>=
i
)
++
depth
;
foreach
(
int
i
,
d
->
m_highlightBlocksInfo
.
close
)
if
(
n
>
i
)
--
depth
;
int
count
=
d
->
m_highlightBlocksInfo
.
count
();
if
(
count
)
{
QRectF
rr
=
r
;
rr
.
setWidth
(
viewport
()
->
width
());
if
(
lineX
>
0
)
rr
.
setRight
(
qMin
(
lineX
,
rr
.
right
()));
for
(
int
i
=
0
;
i
<=
depth
;
++
i
)
{
int
vi
=
i
>
0
?
d
->
m_highlightBlocksInfo
.
visualIndent
.
at
(
i
-
1
)
:
0
;
painter
.
fillRect
(
rr
.
adjusted
(
vi
,
0
,
-
8
*
i
,
0
),
calcBlendColor
(
baseColor
,
i
,
count
));
}
}
offsetFP
.
ry
()
+=
r
.
height
();
if
(
offsetFP
.
y
()
>
viewportRect
.
height
()
+
margin
)
break
;
blockFP
=
blockFP
.
next
();
if
(
!
blockFP
.
isVisible
())
{
// invisible blocks do have zero line count
blockFP
=
doc
->
findBlockByLineNumber
(
blockFP
.
firstLineNumber
());
}
}
}
if
(
!
d
->
m_findScope
.
isNull
())
{
TextEditorOverlay
*
overlay
=
new
TextEditorOverlay
(
this
);
...
...
@@ -2391,6 +2435,10 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
break
;
blockFP
=
blockFP
.
next
();
if
(
!
blockFP
.
isVisible
())
{
// invisible blocks do have zero line count
blockFP
=
doc
->
findBlockByLineNumber
(
blockFP
.
firstLineNumber
());
}
}
}
// end first pass
...
...
@@ -2415,31 +2463,6 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
painter
.
fillRect
(
rr
,
d
->
m_ifdefedOutFormat
.
background
());
}
if
(
!
d
->
m_highlightBlocksInfo
.
isEmpty
())
{
int
n
=
block
.
blockNumber
();
int
depth
=
0
;
foreach
(
int
i
,
d
->
m_highlightBlocksInfo
.
open
)
if
(
n
>=
i
)
++
depth
;
foreach
(
int
i
,
d
->
m_highlightBlocksInfo
.
close
)
if
(
n
>
i
)
--
depth
;
int
count
=
d
->
m_highlightBlocksInfo
.
count
();
if
(
count
)
{
QRectF
rr
=
r
;
rr
.
setWidth
(
viewport
()
->
width
());
if
(
lineX
>
0
)
rr
.
setRight
(
qMin
(
lineX
,
rr
.
right
()));
for
(
int
i
=
0
;
i
<=
depth
;
++
i
)
{
int
vi
=
i
>
0
?
d
->
m_highlightBlocksInfo
.
visualIndent
.
at
(
i
-
1
)
:
0
;
painter
.
fillRect
(
rr
.
adjusted
(
vi
,
0
,
-
8
*
i
,
0
),
calcBlendColor
(
baseColor
,
i
,
count
));
}
}
}
QTextLayout
*
layout
=
block
.
layout
();
#if 0
...
...
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