mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-03 18:44:13 +02:00
bb61dde811
ElementsPanel and ElementsTreeView already force a fixed light palette (white base, black text) on themselves, specifically because element icons are rendered with colors read directly from each .elmt file -- almost always black linework, matching printed-schematic convention -- onto a transparent background. That only stays legible if the row background is reliably light, regardless of the OS/desktop theme. But QAbstractItemView paints row backgrounds using its viewport's palette, not the view widget's own palette. setPalette() on the view itself doesn't propagate to viewport() in the general case, so under styles that actually respect the viewport's (unset, therefore theme-inherited) palette -- e.g. KDE Plasma's Breeze Dark -- the row background falls through to the app's dark palette while the element linework is still literal black, making library icons and terminal symbols invisible. Apply the same QPalette to viewport() right after setPalette() in both constructors, so the fix these two classes already clearly intended actually takes effect under every style. Fixes https://qelectrotech.org/bugtracker/view.php?id=335