Commit 44c4ede4 authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

urlbar: Fix symbol view height when we only have a couple of toplevel symbols

parent a62f36a1
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment