Commit 7c67282c authored by Eike Ziller's avatar Eike Ziller

Give locator popup list a bit more spacing again

The change to using the search result item delegate made the items
squeeze pretty much together. Explicitly add some spacing again.

Task-number: QTCREATORBUG-18457
Change-Id: If056b94e5a1629be574a0d864361dc72e356544a
Reviewed-by: David Schulz's avatarDavid Schulz <david.schulz@qt.io>
parent e1615024
......@@ -99,6 +99,14 @@ private:
QColor mBackgroundColor;
};
class CompletionDelegate : public SearchResultTreeItemDelegate
{
public:
CompletionDelegate(QObject *parent);
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
};
class CompletionList : public Utils::TreeView
{
public:
......@@ -234,7 +242,7 @@ void LocatorModel::addEntries(const QList<LocatorFilterEntry> &entries)
CompletionList::CompletionList(QWidget *parent)
: Utils::TreeView(parent)
{
setItemDelegate(new SearchResultTreeItemDelegate(0, this));
setItemDelegate(new CompletionDelegate(this));
setRootIsDecorated(false);
setUniformRowHeights(true);
header()->hide();
......@@ -893,5 +901,15 @@ LocatorPopup *createLocatorPopup(Locator *locator, QWidget *parent)
return popup;
}
CompletionDelegate::CompletionDelegate(QObject *parent)
: SearchResultTreeItemDelegate(0, parent)
{
}
QSize CompletionDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
{
return SearchResultTreeItemDelegate::sizeHint(option, index) + QSize(0, 2);
}
} // namespace Internal
} // namespace Core
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