messagelist: fix horizontal scrollbar when applying column sizes
ClosedPublic

Authored by dfaure on May 5 2017, 10:39 PM.

Details

Summary

On startup the column sizes were calculated for a viewport without
vertical scrollbar, and then not adjusted when the vertical scrollbar
later appears. My fix is to simply always recalculate column sizes
when the viewport is resized at any point. If I resize the mainwindow
I still don't want a horizontal scrollbar under the messagelist.

This removes the need for showEvent since any change of size triggers
resizeEvent anyway. I also can't see any use for recalculating the
sizes on model reset (e.g. switching folders), QHeaderView appears to
just keep the column sizes when doing that (might be my own QHeaderView
fix, actually).

Test Plan

starting kmail, switching folders, resizing columns...

Diff Detail

Repository
R94 PIM: Message Library
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dfaure created this revision.May 5 2017, 10:39 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptMay 5 2017, 10:39 PM

Yes, finally! many thanks! this was an annoying bug.
I'm currently using the patched version, so far looks good

mlaurent edited edge metadata.May 7 2017, 8:35 AM

I tested your patch when we have 3 defaults column it seems ok but when we add a new one as "recent date" we have subject column size which increase from 1 pixel after each close/open kmail :(

Can this be pushed now that @dfaure fixed the rounding errors in D5763? Or does that change deprecated this one?

Both changes are from me, and they are cumulative (two commits on top of each other).

mlaurent accepted this revision.Jun 23 2017, 8:28 AM
This revision is now accepted and ready to land.Jun 23 2017, 8:28 AM
This revision was automatically updated to reflect the committed changes.