mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-28 21:34:12 +02:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user