Skip to content

Change IconDelegate::paintIcons to only execute when iconWidth > 0#2362

Open
mick-lue wants to merge 2 commits intoModOrganizer2:masterfrom
mick-lue:skip_paintIcons_on_null
Open

Change IconDelegate::paintIcons to only execute when iconWidth > 0#2362
mick-lue wants to merge 2 commits intoModOrganizer2:masterfrom
mick-lue:skip_paintIcons_on_null

Conversation

@mick-lue
Copy link
Copy Markdown

@mick-lue mick-lue commented Apr 13, 2026

Bug

When too many Content Icons are supposed to render in too little space in the mod table, the code tries to create a pixmap with dimensions 0x0 resulting in a null icon and generating warning messages in the log.

How to reproduce

  • create a mod (or separator with many mods below it) which include many different file content categories
  • 11 different content categories triggered the warning messages for me on default MO2 resolution with 1440p monitor
  • alternatively resize the Content row to make it very small
  • You might need to scroll to a "new" entry to trigger this code

Fix

Calculate the iconWidth first and then decide if we want to draw icons.

Side effects?

I didn't encounter any unusual behavior and have been using this for a week now.
Content categories still get shown as usual when hovering over the content row of a modlist entry where this code skipped the icon painting.
It also looks the same whether or not null icons get "drawn".
Anything else that needs to be tested?

Edit: I said "category" but I meant "content"

Example:
grafik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant