Bug 175901 - Display Cover popup should be centered and autosized
Summary: Display Cover popup should be centered and autosized
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 2.0-SVN
Platform: unspecified Linux
: LO wishlist
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-23 16:26 UTC by simon
Modified: 2009-12-09 11:29 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch against SVN Rev. 989103. Improved "show cover" dialog. (5.20 KB, patch)
2009-06-29 15:55 UTC, Pascal Pollet
Details
corrected previous patch (6.92 KB, patch)
2009-06-29 17:29 UTC, Pascal Pollet
Details
some more improvements... (7.12 KB, patch)
2009-06-29 18:27 UTC, Pascal Pollet
Details
better handling of multiple screens. Better handling of large covers. (1.67 KB, text/plain)
2009-06-30 11:38 UTC, Pascal Pollet
Details
[patch] multiple screens: Cover should popup on the same screen than the parent window. (2.64 KB, text/plain)
2009-06-30 14:08 UTC, Pascal Pollet
Details
[patch] resizing is much smoother now. Removed centering of window. (5.96 KB, text/plain)
2009-07-01 16:53 UTC, Pascal Pollet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description simon 2008-11-23 16:26:57 UTC
Version:           2.0-SVN (using 4.1.80 (KDE 4.1.80 (KDE 4.2 Beta1)), Gentoo)
Compiler:          x86_64-pc-linux-gnu-gcc
OS:                Linux (x86_64) release 2.6.26-tuxonice

it would be nice if the "view Cover" popup was centered and autosized, at least if the cover is smaller than the available screen size
Comment 1 Andrey Esin 2008-11-23 16:32:02 UTC
I agree...but i think it will be only after release.
Comment 2 Pascal Pollet 2009-06-29 15:55:17 UTC
Created attachment 34907 [details]
Patch against SVN Rev. 989103. Improved "show cover" dialog.
Comment 3 Pascal Pollet 2009-06-29 15:56:11 UTC
Hi,
Hi,

I reimplemented the dialog, it now automatically centers on the screen and it's size fits the cover's size. You can zoom out and in on the cover with the mouse wheel. The window size automatically adapts on the new cover size and centers on the screen everytime the zoom factor has changed. If the cover's original size is greater than the desktop's resolution, it is scaled to fit onto the desktop before the dialog pops up. In this implementation, there is no more need for scroll bars, so i removed them...

For suggestions or criticism please contact me, I would love to help further in amarok development :)
Comment 4 Pascal Pollet 2009-06-29 17:29:04 UTC
Created attachment 34909 [details]
corrected previous patch

- corrected formatting (tabs to spaces, indentation, length of lines, etc...)
- changed names of instance variables according the conventions (m_xxxx)
- patch can now be applied inside the amarok directory
Comment 5 Pascal Pollet 2009-06-29 18:27:44 UTC
Created attachment 34911 [details]
some more improvements...

the implementation for covers larger than the desktop resolution wasn't good. I corrected it now...
Comment 6 Nikolaj Hald Nielsen 2009-06-29 23:15:37 UTC
SVN commit 989288 by nhnielsen:

Improvements to the "show cover" dialog.

- Auto center on screen
- Size matches cover size (if it fits on screen, scales down cover otherwise)
- Zooming/resizing using mouse wheel
- No more scrollbars

Thanks to Pascal Pollet <pascal@bongosoft.de> for the patch! :-)

BUG: 175901



 M  +92 -31    PixmapViewer.cpp  
 M  +18 -11    PixmapViewer.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=989288
Comment 7 Nikolaj Hald Nielsen 2009-06-29 23:24:11 UTC
Whoops! :-)

Pascal, I missed your most recent patch with the changes to the handling of large covers as I had already gotten the previous patch ready for comitting before I had to leave for a while. I committed it when I got back and did not see that you had created yet another one. Could you please update from svn, and create a patch with just the last changes? With any luck, svn should correctly merge stuff if you just update without reverting your local changes.
Comment 8 Pascal Pollet 2009-06-30 10:45:28 UTC
Hello Nikolaj,

yes, I was a bit chaotic with my many patches ;) Thank's for having
reformatted the code! I'll make a new patch on this basis, it's not much
work because it were only 2 or 3 lines of code that changed...

bye
Pascal



Nikolaj Hald Nielsen schrieb:
> https://bugs.kde.org/show_bug.cgi?id=175901
>
>
> Nikolaj Hald Nielsen <nhnFreespirit@gmail.com> changed:
>
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |nhnFreespirit@gmail.com
>
>
>
>
> --- Comment #7 from Nikolaj Hald Nielsen <nhnFreespirit gmail com>  2009-06-29 23:24:11 ---
> Whoops! :-)
>
> Pascal, I missed your most recent patch with the changes to the handling of
> large covers as I had already gotten the previous patch ready for comitting
> before I had to leave for a while. I committed it when I got back and did not
> see that you had created yet another one. Could you please update from svn, and
> create a patch with just the last changes? With any luck, svn should correctly
> merge stuff if you just update without reverting your local changes.
>
>
Comment 9 Pascal Pollet 2009-06-30 11:38:28 UTC
Created attachment 34935 [details]
better handling of multiple screens. Better handling of large covers.
Comment 10 Pascal Pollet 2009-06-30 14:08:39 UTC
Created attachment 34939 [details]
[patch] multiple screens: Cover should popup on the same screen than the parent window.

Please test it, I don't have multiple screens here :)
Comment 11 Pascal Pollet 2009-06-30 15:06:49 UTC
like reported by testers the placement of the window with multiple monitors doesn't seem to work like intended now. The window should open on the same monitor than the main window of amarok. I will try to fix this issue later when I'm sitting on a PC with multiple monitors...
Comment 12 simon 2009-06-30 21:40:34 UTC
could the repaint flickering when zooming be reduced somehow? its a bit choppy because first the window is moved and then resized, can this be made smoother?
Comment 13 Pascal Pollet 2009-07-01 11:33:06 UTC
it's a good point Simon. I removed a repaint() call that was too much, and a little bit of code in the paintEvent function that wasn't needed anymore, and now it resizes much more smoothly.

I wait to send the patch until I solved the "multiple screens" problems, it let me go crazy yesterday evening, Qt4 seems to be a mess regarding the handling of more than one screen :(
Comment 14 Pascal Pollet 2009-07-01 16:53:47 UTC
Created attachment 34977 [details]
[patch] resizing is much smoother now. Removed centering of window.

hmmm, no matter what I'm programming, the "move" command will always move the window to the secondary screen on a dualview setup, I really tried everything! I followed exactly the instructions in the Qt4 API, but there is really no way to control to which monitor the window will be moved... I'm quite sure it is a bug in the Qt4 API, nobody could really help me in the Qt-IRC... 

I now completely removed the code for the "move" command, so that the window doesn't get centered on the screen anymore... But at least, it will stay on the same monitor as the parent window. If someone is interested in the not working code for moving the window to try to debug it, please ask me...

in return, the resizing of the window is much smoother now :)
Comment 15 Nikolaj Hald Nielsen 2009-07-02 10:37:25 UTC
SVN commit 990288 by nhnielsen:

More "Show Cover" improvements by Pascal Pollet <pascal@bongosoft.de>
- Much smoother zooming.
- No longer try to center on screen as that causes issues on multi screen setups.

CCBUG: 175901



 M  +7 -1      covermanager/CoverFetchingActions.cpp  
 M  +6 -3      covermanager/CoverViewDialog.h  
 M  +14 -30    widgets/PixmapViewer.cpp  
 M  +1 -1      widgets/PixmapViewer.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=990288