Better defaults, fix bugs with icon size

This commit is contained in:
Clement Lefebvre 2010-09-23 18:27:04 +01:00
parent 6197751172
commit 95063d3124
3 changed files with 9 additions and 11 deletions

View File

@ -166,8 +166,7 @@ class Menu:
class SuggestionButton ( gtk.Button ): class SuggestionButton ( gtk.Button ):
def __init__( self, iconName, iconSize, label ): def __init__( self, iconName, iconSize, label ):
gtk.Button.__init__( self ) gtk.Button.__init__( self )
iconSize = self.get_icon_size(iconSize)
self.iconName = iconName self.iconName = iconName
self.set_relief( gtk.RELIEF_NONE ) self.set_relief( gtk.RELIEF_NONE )
self.set_size_request( -1, -1 ) self.set_size_request( -1, -1 )
@ -197,8 +196,7 @@ class SuggestionButton ( gtk.Button ):
def set_text( self, text): def set_text( self, text):
self.label.set_markup(text) self.label.set_markup(text)
def set_icon_size (self, size): def set_icon_size (self, size):
size = self.get_icon_size(size)
self.image.set_from_stock( self.iconName, size ) self.image.set_from_stock( self.iconName, size )
class pluginclass( object ): class pluginclass( object ):
@ -470,7 +468,7 @@ class pluginclass( object ):
self.width = self.gconf.get( "int", "width", 480 ) self.width = self.gconf.get( "int", "width", 480 )
self.height = self.gconf.get( "int", "height", 410 ) self.height = self.gconf.get( "int", "height", 410 )
self.donotfilterapps = self.gconf.get( "bool", "do_not_filter", False ) self.donotfilterapps = self.gconf.get( "bool", "do_not_filter", False )
self.iconSize = self.gconf.get( "int", "icon_size", 24 ) self.iconSize = self.gconf.get( "int", "icon_size", 22 )
self.faviconsize = self.gconf.get( "int", "favicon_size", 48 ) self.faviconsize = self.gconf.get( "int", "favicon_size", 48 )
self.favCols = self.gconf.get( "int", "fav_cols", 2 ) self.favCols = self.gconf.get( "int", "fav_cols", 2 )
self.swapgeneric = self.gconf.get( "bool", "swap_generic_name", False ) self.swapgeneric = self.gconf.get( "bool", "swap_generic_name", False )

View File

@ -99,7 +99,7 @@ class pluginclass( object ):
def GetGconfEntries( self ): def GetGconfEntries( self ):
self.width = self.gconf.get( "int", "width", 200 ) self.width = self.gconf.get( "int", "width", 200 )
self.allowScrollbar = self.gconf.get( "bool", "allowScrollbar", True) self.allowScrollbar = self.gconf.get( "bool", "allowScrollbar", False)
self.showGTKBookmarks = self.gconf.get( "bool", "show_gtk_bookmarks", False) self.showGTKBookmarks = self.gconf.get( "bool", "show_gtk_bookmarks", False)
self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC ) self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC )
self.height = self.gconf.get( "int", "height", 180 ) self.height = self.gconf.get( "int", "height", 180 )
@ -109,7 +109,7 @@ class pluginclass( object ):
self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER ) self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER )
self.content_holder.set_size_request( self.width, self.height ) self.content_holder.set_size_request( self.width, self.height )
self.execapp = self.gconf.get( "string", "execute_app", "nautilus" ) self.execapp = self.gconf.get( "string", "execute_app", "nautilus" )
self.iconsize = self.gconf.get( "int","icon_size", 22 ) self.iconsize = self.gconf.get( "int","icon_size", 16 )
# Check default items # Check default items
@ -159,7 +159,7 @@ class pluginclass( object ):
self.mintMenuWin.setTooltip( Button2, _("Open your personal folder") ) self.mintMenuWin.setTooltip( Button2, _("Open your personal folder") )
if ( self.shownetwork == True ): if ( self.shownetwork == True ):
Button3 = easyButton( "network-workgroup", self.iconsize, [_("Network")], -1, -1 ) Button3 = easyButton( "notification-network-ethernet-connected", self.iconsize, [_("Network")], -1, -1 )
Button3.connect( "clicked", self.ButtonClicked, "nautilus network:" ) Button3.connect( "clicked", self.ButtonClicked, "nautilus network:" )
Button3.show() Button3.show()
self.placesBtnHolder.pack_start( Button3, False, False ) self.placesBtnHolder.pack_start( Button3, False, False )

View File

@ -100,7 +100,7 @@ class pluginclass( object ):
self.height = -1 self.height = -1
self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER ) self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER )
self.content_holder.set_size_request( self.width, self.height ) self.content_holder.set_size_request( self.width, self.height )
self.iconsize = self.gconf.get( "int","icon_size", 22 ) self.iconsize = self.gconf.get( "int","icon_size", 16 )
# Check toggles # Check toggles
@ -131,14 +131,14 @@ class pluginclass( object ):
if ( self.showSoftwareManager == True ): if ( self.showSoftwareManager == True ):
if os.path.exists("/usr/lib/linuxmint/mintInstall/icon.svg"): if os.path.exists("/usr/lib/linuxmint/mintInstall/icon.svg"):
Button1 = easyButton( "/usr/lib/linuxmint/mintInstall/icon.svg", self.iconsize, [_("Software Manager")], -1, -1 ) Button1 = easyButton( "applications-other", self.iconsize, [_("Software Manager")], -1, -1 )
Button1.connect( "clicked", self.ButtonClicked, "mintinstall" ) Button1.connect( "clicked", self.ButtonClicked, "mintinstall" )
Button1.show() Button1.show()
self.systemBtnHolder.pack_start( Button1, False, False ) self.systemBtnHolder.pack_start( Button1, False, False )
self.mintMenuWin.setTooltip( Button1, _("Browse and install available software") ) self.mintMenuWin.setTooltip( Button1, _("Browse and install available software") )
if ( self.showPackageManager == True ): if ( self.showPackageManager == True ):
Button2 = easyButton( "synaptic", self.iconsize, [_("Package Manager")], -1, -1 ) Button2 = easyButton( "applications-system", self.iconsize, [_("Package Manager")], -1, -1 )
Button2.connect( "clicked", self.ButtonClicked, "gksu /usr/sbin/synaptic" ) Button2.connect( "clicked", self.ButtonClicked, "gksu /usr/sbin/synaptic" )
Button2.show() Button2.show()
self.systemBtnHolder.pack_start( Button2, False, False ) self.systemBtnHolder.pack_start( Button2, False, False )