summaryrefslogtreecommitdiff
path: root/src/plugins/coreplugin
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2017-07-05 15:43:07 +0200
committerEike Ziller <eike.ziller@qt.io>2017-07-06 08:38:29 +0000
commit7c67282cf0bcad8602662ac6ade66a1c47912577 (patch)
treee5fca5ee01310da30cb6c84a8f3810716c0f98ad /src/plugins/coreplugin
parente1615024cf9f22be8ecb64e5443f69523ea04547 (diff)
downloadqt-creator-7c67282cf0bcad8602662ac6ade66a1c47912577.tar.gz
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 <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/coreplugin')
-rw-r--r--src/plugins/coreplugin/locator/locatorwidget.cpp20
1 files changed, 19 insertions, 1 deletions
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<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