Simpler version of column resizing code for Akregator
Review Request #100574 - Created Feb. 5, 2011 and discarded
My previous implementation of column resizing for the article view was too smart for its own good: - It prevented the user from enlarging the title column if it would have made the total column width greater than the viewport width - It did not compute the width of the date column correctly This new version is simpler: it just resize all columns but the title one to fit their content. The title column gets the remaining width.
Tested both feed and group mode. Columns get reasonable widths and can be resized if need be (sometimes necessary for title column)
This patch introduces more issues that it solves. See the comments and screenshots in the bug report. - Usability issue, the columns sizes are not remembered anymore. Auto-resizing columns is a *very bad* idea. - When a feed has a long description or author, the title is unreadable, - When there is no vertical scrollbar, there's an empty area next to the date column
Indeed, QTreeView column resizing is hard. Ideally I'd like to have a class KTreeView in kdelibs that handles everything for you. Simply inherit from it and column resizing is handled sanely and consistent(!) across all KDE apps using that.
Review request changed
I said I would not spend more time on this but then I got an even crazier idea: - Hide the header of the article list - Set the title column in stretch mode - Move the column selection menu to the article list view context menu Advantages of this version: - Since title column is in stretch mode it always uses as much space as possible, without any hack. One can see more by either enlarging the window, adjusting the feed-list|article-list splitter or hiding some columns. - Since the header is hidden, it feels less "jumpy" when Author column size adjust after changing to another feed. - Hiding the header avoids the feeling that one can't resize the title column. The column content is explicit enough that it does not need a label IMO. - Hiding the header also avoids accidentally clicking on the "Title" header when one tries to select the first item, resulting in a change in sort order instead (this was reported by a few people when I blogged about Akregator article view) - Finally, hiding the header makes it possible to see one more article. Drawbacks: - Impossible to reorder columns - Impossible to change sort order (that could be added to the popup menu, but it does not feel necessary to me) What do you think?
Revision 2 (+54 -97)