BUG: 355592
Details
- Reviewers
davidedmundson hein - Group Reviewers
Plasma - Commits
- R242:d46a91ea57f1: [Icon Item] Support non-square icons
Tests still pass, added a test for paintedWidth/paintedHeight
Now getting non-square thumbs in FolderView (will make a patch for FolderView to let IconItem span the full delegate width to make better use of available space for wide thumbs)
Everything else looks as normal, icons still rounded to icon sizes and square usually, verified that paintedWidth/paintedHeight is always updated and correct
Diff Detail
- Repository
- R242 Plasma Framework (Library)
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
src/declarativeimports/core/iconitem.cpp | ||
---|---|---|
325 | This makes no sense. If we do merge this patch, you want: m_iconPixmap.size().scaled(QSize(Units.roundtoIconSize(actualContainerSize.width), Units.roundToIconSize(actualContainerSize.height) | |
377 | You're using references a lot in a few patches that don't make any sense. paintedSize returns a new QSize object; you're keeping a reference to a value that would just be immediately discarded. This doesn't result in an optimisation but instead doing something that would crash if it wasn't for a magic C++ feature where it lengthens the lifespan of the object. |
src/declarativeimports/core/iconitem.cpp | ||
---|---|---|
325 | the final size should be: |
src/declarativeimports/core/iconitem.cpp | ||
---|---|---|
325 | Copying a better explanation of the bug here from on IRC: [13:09] <d_ed> kbroulik: assuming the standard icon sizes are 16,32,48 if I have an icon that is 48x45 your paintedSize will return 48x32 [13:12] <d_ed>and your unit test currently only passes because roundToIcon size has a code path of if size > KIconLoader::SizeHuge return size |
- Don't blindly round both sizes, instead round one and then scale the other accordingly
- Adjust unit test