From 7c67282cf0bcad8602662ac6ade66a1c47912577 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 5 Jul 2017 15:43:07 +0200 Subject: 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 --- src/plugins/coreplugin/locator/locatorwidget.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/plugins/coreplugin') diff --git a/src/plugins/coreplugin/locator/locatorwidget.cpp b/src/plugins/coreplugin/locator/locatorwidget.cpp index 61282cfb85..59f5e9b6a4 100644 --- a/src/plugins/coreplugin/locator/locatorwidget.cpp +++ b/src/plugins/coreplugin/locator/locatorwidget.cpp @@ -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 &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 -- cgit v1.2.1