[PATCH] juk: save & restore playlist and tag editor sizes.

Γιώργος Κυλάφας (Giorgos Kylafas) gekylafas at gmail.com
Mon May 9 10:43:20 BST 2011

2011/5/7 Michael Pyne <mpyne at kde.org>:
> On Saturday, May 07, 2011 01:10:31 Γιώργος Κυλάφας wrote:
>> the full motivation behind my proposed fix about the storing of
>> TagEditor's configuration on exit [1] was to show or not the TagEditor
>> *and* use the same size as the previous execution of JuK. However, the
>> latter was not supported, so I set out to implement it.
>> I eventually came up with the attached patch. It follows the logic of
>> saving/restoring the PlaylistSplitter's size, applied to
>> "editorSplitter".
>> I am not sure this is the proper/simpler/etc. way to accomplish this,
>> so I would appreciate your comments. :-)
> The patch works and is the right method.
> I'm not sure why you set sizes of 250/240 if no sizes were already saved
> though, doesn't the size hint for the tag editor give it a good default size?
> If so you wouldn't need to do anything special if there is no saved sized
> other than to not call m_editorSplitter->setSizes().
> Either way the patch should be fine to commit once you've figured out which
> looks more suitable (it's just that we don't all run the same resolution
> screens so I try to avoid fixed default sizes where I can ;)

Well, PlaylistSplitter's default sizes are 100/640, which I guessed
were derived from line "resize(750, 500)" in JuK::setupLayout(). i.e.
100 + 640 = 750 - 10. So, I used the same reasoning (250 + 240 = 500 -
10) for the m_editorSplitter as well. :-)

I tried not calling setSizes() if no sizes are saved, however the tag
editor would get very large compared to the playlist.

According to http://doc.qt.nokia.com/4.7/qsplitter.html#setSizes:
 "The overall size of the splitter widget is not affected. Instead,
any additional/missing space is distributed amongst the widgets
according to the relative weight of the sizes."

So, in the attached new version of my patch I ended up setting the
same size to both the editor and the playlist. Since the actual size
does not matter much (only the relative weight) and since we should
not use fixed sizes, I used the tag editor's height


Γιώργος Κυλάφας (Giorgos Kylafas)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: save-n-restore-tag-editor-size.patch
Type: text/x-diff
Size: 3687 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-multimedia/attachments/20110509/26d4578a/attachment.patch>
-------------- next part --------------
kde-multimedia mailing list
kde-multimedia at kde.org

More information about the kde-multimedia mailing list