Ticket #160 (closed enhancement: fixed)

Opened 16 months ago

Last modified 16 months ago

Patch for zoom in/out the userinfo image

Reported by: gallows Owned by: daelstorm
Priority: minor Milestone:
Component: nicotine Version: SVN (checked out today)
Keywords: patch Cc:

Description

Hi,
I wrote this little patch, hope you find it useful.
I basically added an EventBox? on the UserInfoTab? so to handle the mouse scroll signals in order to increase and decrease image size.

List of modifications:
userinfo.py:
Added three functions (on class UserInfo?).

  • OnScrollEvent() - it manages to handle the signal of the EventBox? I added, by calling one of the following two functions:
  • MakeZoomIn()
  • MakeZoomOut()

Furthermore I added the following variables (always in the same class):

  • self.image_pixbuf - for the zoom (otherwise the image quality is compromised when zooming), but also for the image saving (little change already realized).
  • self.zoom_factor - the zoom factor. This is not necessary, but anyway preferable than a "magic number".
  • self.actual_zoom - records the current value of the zoom.

I had to call the garbage collector on every zoom because a strange GC behaviour [1]

glade2py.py:
Added the support for a GtkEventBox?.

nicotine.glade:
I just added an EventBox? (between viewport2 and image) to which i connected (on scroll signal) the function OnScrollEvent()
(I used glade-2)

[1] http ://live.gnome.org/PyGTK/FAQ/Images#head-52bfc2c7be6e35b266b80032891978f04cb8a3e8

Thanks for the developing of nicotine+,

Sergio Perticone aka gallows

Attachments

glade2py.py.diff (0.6 kB) - added by Sergio Perticone 16 months ago.
userinfo.py.diff (2.6 kB) - added by Sergio Perticone 16 months ago.

Change History

Changed 16 months ago by Sergio Perticone

Changed 16 months ago by Sergio Perticone

Changed 16 months ago by Sergio Perticone

I can't attach nicotine.glade.diff (too big):
http: //perticone.homelinux.net/~sergio/python/nicotine+/patches070507/nicotine.glade.diff

Changed 16 months ago by daelstorm

  • status changed from new to assigned

Neato! I'm nearly done merging the patch into svn.

Changed 16 months ago by daelstorm

  • status changed from assigned to closed
  • resolution set to fixed

added to subversion, yesterday

Add/Change #160 (Patch for zoom in/out the userinfo image)

Author



Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.