Skip to content
GitLab
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
44c4ede4
Commit
44c4ede4
authored
Feb 22, 2022
by
Waqar Ahmed
Browse files
urlbar: Fix symbol view height when we only have a couple of toplevel symbols
parent
a62f36a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
kate/kateurlbar.cpp
View file @
44c4ede4
...
...
@@ -307,7 +307,7 @@ public:
void
updateGeometry
()
{
const
auto
*
model
=
m_tree
->
model
();
const
int
rows
=
model
->
rowCount
();
const
int
rows
=
rowCount
(
model
);
const
int
rowHeight
=
m_tree
->
sizeHintForRow
(
0
);
const
int
maxHeight
=
rows
*
rowHeight
;
...
...
@@ -341,6 +341,18 @@ public:
}
private:
// row count that counts top level + 1 level down rows
// needed to ensure we don't get strange heights for
// cases where there are only a couple of top level symbols
int
rowCount
(
const
QAbstractItemModel
*
model
)
{
int
rows
=
model
->
rowCount
({});
for
(
int
i
=
0
;
i
<
rows
;
++
i
)
{
rows
+=
model
->
rowCount
(
model
->
index
(
i
,
0
));
}
return
rows
;
}
QTreeView
*
m_tree
;
QPointer
<
KTextEditor
::
View
>
m_activeView
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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