forked from qt-creator/qt-creator
Fix selection color in locator popup
On macOS and Windows the background of the selected item in locator would be light gray, since the popup doesn't really get focus there. We still want it to look the same as if it had focus, so change the palette accordingly. Fixes: QTCREATORBUG-22118 Change-Id: Iefbbd49b4980a01de494e33ddb8e43e2d5a15716 Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
@@ -252,6 +252,14 @@ void LocatorModel::addEntries(const QList<LocatorFilterEntry> &entries)
|
||||
CompletionList::CompletionList(QWidget *parent)
|
||||
: Utils::TreeView(parent)
|
||||
{
|
||||
// on macOS and Windows the popup doesn't really get focus, so fake the selection color
|
||||
// which would then just be a very light gray, but should look as if it had focus
|
||||
QPalette p = palette();
|
||||
p.setBrush(QPalette::Inactive,
|
||||
QPalette::Highlight,
|
||||
p.brush(QPalette::Normal, QPalette::Highlight));
|
||||
setPalette(p);
|
||||
|
||||
setItemDelegate(new CompletionDelegate(this));
|
||||
setRootIsDecorated(false);
|
||||
setUniformRowHeights(true);
|
||||
|
||||
Reference in New Issue
Block a user