Problem/Motivation
Panels overrides the Layout icons even if there's an icon map that could be displayed. This is especially annoying in Layout Builder.
Proposed resolution
Check if there's an icon map in panels_layout_alter before setting the no preview icon.
User interface changes
Before:

After:

| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3030976-3-PASS.patch | 1.72 KB | phenaproxima |
| #3 | 3030976-3-FAIL.patch | 891 bytes | phenaproxima |
| #2 | fix-iconMap-for-layoutbuilder-3030976-2.patch | 866 bytes | colincalnan |
| initial.patch | 727 bytes | bendeguz.csirmaz | |
| after.png | 37.23 KB | bendeguz.csirmaz |
Comments
Comment #2
colincalnan commentedNice work https://www.drupal.org/u/bendeguzcsirmaz, however I do believe there's a neater solution to this.
The core LayoutDefinition plugin provides a method called `getIcon` which does the necessary checks for icon maps and icon images/paths and returns correctly.
I simply updated Panels to call this method to retrieve an icon map.
Comment #3
phenaproximaHere's a test...let's get this committed.
Comment #5
tim.plunkettNice fix! Thanks
Comment #7
phenaproximaCommitted and pushed to 8.x-4.x. Thanks!