Show element icons light on a dark palette in search results and the picker

The collection tree draws element previews through ElementPreviewDelegate,
which inverts the black line art on a dark palette. The ranked search list
(#1051) and the Insert element picker (#1052) are separate views and never
installed it, so their icons stayed black on a dark background.

Install the delegate on the ranked list, the picker's list and the shortcut
bar editor's lists, and adapt the pinned-element buttons' icons directly.
Coloured icons and light palettes are unchanged.

Reported in #1083.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ispyisail
2026-09-28 11:30:08 +13:00
parent 37674d836f
commit c7f4a4f01d
2 changed files with 13 additions and 1 deletions
@@ -27,6 +27,7 @@
#include "../qetmessagebox.h"
#include "../qetproject.h"
#include "elementcollectionitem.h"
#include "elementpreviewdelegate.h"
#include "elementscollectionmodel.h"
#include "elementslocation.h"
#include "elementstreeview.h"
@@ -258,6 +259,8 @@ void ElementsCollectionWidget::setUpWidget()
m_search_model = new QStandardItemModel(this);
m_search_results = new SearchResultsView(this);
m_search_results->setModel(m_search_model);
//Same dark-palette icons as the tree the list stands in for
m_search_results->setItemDelegate(new ElementPreviewDelegate(m_search_results));
m_search_results->setDragDropMode(QAbstractItemView::DragOnly);
m_search_results->setIconSize(QSize(50, 50));
m_search_results->setUniformItemSizes(false);