Use pygtk to brighten image when menu is hovered
This commit is contained in:
parent
a9afef23d2
commit
aaef795ec5
1
debian/changelog
vendored
1
debian/changelog
vendored
@ -3,6 +3,7 @@ mintmenu (4.8.7) helena; urgency=low
|
|||||||
* Replaced xdg with gmenu (Fixes broken Games category)
|
* Replaced xdg with gmenu (Fixes broken Games category)
|
||||||
* Removed calls to mouse grabs (Could fix weird bug about not being able to grab the mouse)
|
* Removed calls to mouse grabs (Could fix weird bug about not being able to grab the mouse)
|
||||||
* Made Pidgin a favorite in replacement of Xchat
|
* Made Pidgin a favorite in replacement of Xchat
|
||||||
|
* Hover menu icon now uses pygtk to brighten the chosen picture: Fixes problem with custom menu icons
|
||||||
|
|
||||||
-- Clement Lefebvre <root@linuxmint.com> Thu, 19 Nov 2009 08:52:00 +0000
|
-- Clement Lefebvre <root@linuxmint.com> Thu, 19 Nov 2009 08:52:00 +0000
|
||||||
|
|
||||||
|
@ -44,7 +44,6 @@ gettext.install("mintmenu", "/usr/share/linuxmint/locale")
|
|||||||
NAME = _("Menu")
|
NAME = _("Menu")
|
||||||
PATH = os.path.abspath( os.path.dirname( sys.argv[0] ) )
|
PATH = os.path.abspath( os.path.dirname( sys.argv[0] ) )
|
||||||
ICON = "/usr/lib/linuxmint/mintMenu/mintMenu.png"
|
ICON = "/usr/lib/linuxmint/mintMenu/mintMenu.png"
|
||||||
ICON_HOVER = "/usr/lib/linuxmint/mintMenu/mintMenu_hover.png"
|
|
||||||
|
|
||||||
sys.path.append( os.path.join( PATH , "plugins") )
|
sys.path.append( os.path.join( PATH , "plugins") )
|
||||||
|
|
||||||
@ -602,13 +601,15 @@ class MenuWin( object ):
|
|||||||
print cause
|
print cause
|
||||||
|
|
||||||
def enter_notify(self, applet, event):
|
def enter_notify(self, applet, event):
|
||||||
self.do_image(self.buttonIcon_hover)
|
self.do_image(self.buttonIcon, True)
|
||||||
|
|
||||||
def leave_notify(self, applet, event):
|
def leave_notify(self, applet, event):
|
||||||
self.do_image(self.buttonIcon)
|
self.do_image(self.buttonIcon, False)
|
||||||
|
|
||||||
def do_image(self, image_file):
|
def do_image(self, image_file, saturate):
|
||||||
pixbuf = gtk.gdk.pixbuf_new_from_file(image_file)
|
pixbuf = gtk.gdk.pixbuf_new_from_file(image_file)
|
||||||
|
if saturate:
|
||||||
|
gtk.gdk.Pixbuf.saturate_and_pixelate(pixbuf, pixbuf, 1.5, False)
|
||||||
self.button_icon.set_from_pixbuf(pixbuf)
|
self.button_icon.set_from_pixbuf(pixbuf)
|
||||||
|
|
||||||
def createPanelButton( self ):
|
def createPanelButton( self ):
|
||||||
@ -655,7 +656,6 @@ class MenuWin( object ):
|
|||||||
self.buttonText = self.gconf.get( "string", "applet_text", "Menu" )
|
self.buttonText = self.gconf.get( "string", "applet_text", "Menu" )
|
||||||
self.hotkeyText = self.gconf.get( "string", "hot_key", "<Control>Super_L" )
|
self.hotkeyText = self.gconf.get( "string", "hot_key", "<Control>Super_L" )
|
||||||
self.buttonIcon = self.gconf.get( "string", "applet_icon", ICON )
|
self.buttonIcon = self.gconf.get( "string", "applet_icon", ICON )
|
||||||
self.buttonIcon_hover = self.gconf.get( "string", "applet_icon_hover", ICON_HOVER )
|
|
||||||
self.setIconSize( self.gconf.get( "int", "applet_icon_size", 2 ) )
|
self.setIconSize( self.gconf.get( "int", "applet_icon_size", 2 ) )
|
||||||
|
|
||||||
def setIconSize( self, icon_size):
|
def setIconSize( self, icon_size):
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
Loading…
Reference in New Issue
Block a user