From d3a96e305e308ebc76c7d47bf1573003302d5fc3 Mon Sep 17 00:00:00 2001 From: clhodapp Date: Fri, 9 Oct 2009 13:32:23 -0500 Subject: [PATCH] Ability to disable scrollbar for/autoresize Places --- .../linuxmint/mintMenu/mintMenuConfig.glade | 18 +++++++++++++++--- usr/lib/linuxmint/mintMenu/mintMenuConfig.py | 2 ++ .../linuxmint/mintMenu/plugins/places.glade | 17 ++++++++++------- usr/lib/linuxmint/mintMenu/plugins/places.py | 9 +++++++-- 4 files changed, 34 insertions(+), 12 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade b/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade index 233661e..b97c161 100644 --- a/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade +++ b/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade @@ -837,6 +837,18 @@ True vertical + + + Allow Scrollbar + True + True + False + True + + + 0 + + True @@ -878,7 +890,7 @@ 4 - 0 + 1 @@ -974,7 +986,7 @@ - 1 + 2 @@ -1134,7 +1146,7 @@ - 3 + 4 diff --git a/usr/lib/linuxmint/mintMenu/mintMenuConfig.py b/usr/lib/linuxmint/mintMenu/mintMenuConfig.py index b280157..5b3fef7 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenuConfig.py +++ b/usr/lib/linuxmint/mintMenu/mintMenuConfig.py @@ -122,6 +122,7 @@ class mintMenuConfig( object ): self.desktoptoggle = wTree.get_widget( "desktopcheckbutton" ) self.trashtoggle = wTree.get_widget( "trashcheckbutton" ) self.customplacestree = wTree.get_widget( "customplacestree" ) + self.allowScrollbarToggle = wTree.get_widget( "allowscrollbarcheckbutton" ) self.placesHeightBox = wTree.get_widget( "placesHeightSpinBox" ) wTree.get_widget( "closeButton" ).connect("clicked", gtk.main_quit ) @@ -164,6 +165,7 @@ class mintMenuConfig( object ): self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_desktop", self.desktoptoggle, "toggled", self.desktoptoggle.set_active, self.desktoptoggle.get_active ) self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_trash", self.trashtoggle, "toggled", self.trashtoggle.set_active, self.trashtoggle.get_active ) self.bindGconfValueToWidget( self.gconfPlaces, "int", "height", self.placesHeightBox, "value-changed", self.placesHeightBox.set_value, self.placesHeightBox.get_value_as_int ) + self.bindGconfValueToWidget( self.gconfPlaces, "bool", "allowScrollbar", self.allowScrollbarToggle, "toggled", self.allowScrollbarToggle.set_active, self.allowScrollbarToggle.get_active ) self.customplacenames = self.gconfPlaces.get( "list-string", "custom_names", [ ] ) self.customplacepaths = self.gconfPlaces.get( "list-string", "custom_paths", [ ] ) diff --git a/usr/lib/linuxmint/mintMenu/plugins/places.glade b/usr/lib/linuxmint/mintMenu/plugins/places.glade index bd2b517..1fd8153 100644 --- a/usr/lib/linuxmint/mintMenu/plugins/places.glade +++ b/usr/lib/linuxmint/mintMenu/plugins/places.glade @@ -1,7 +1,7 @@ - - - + + + @@ -11,15 +11,15 @@ True True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC + automatic + automatic True - GTK_SHADOW_NONE + none True @@ -29,11 +29,14 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 2 + + 0 + True - GTK_BUTTONBOX_START + start False diff --git a/usr/lib/linuxmint/mintMenu/plugins/places.py b/usr/lib/linuxmint/mintMenu/plugins/places.py index d1add7d..10401cb 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/places.py +++ b/usr/lib/linuxmint/mintMenu/plugins/places.py @@ -30,7 +30,7 @@ class pluginclass( object ): wTree = gtk.glade.XML( gladefile, "mainWindow" ) self.placesBtnHolder = wTree.get_widget( "places_button_holder" ) self.editableBtnHolder = wTree.get_widget( "editable_button_holder" ) - + self.scrolledWindow=wTree.get_widget("scrolledwindow2") # These properties are NECESSARY to maintain consistency # Set 'window' property for the plugin (Must be the root widget) @@ -82,7 +82,12 @@ class pluginclass( object ): def GetGconfEntries( self ): self.width = self.gconf.get( "int", "width", 200 ) - self.height = self.gconf.get( "int", "height", 155 ) + self.allowScrollbar = self.gconf.get( "bool", "allowScrollbar", False) + if (self.allowScrollbar == False): + self.height = -1 + self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER ) + else: + self.height = self.gconf.get( "int", "height", 155 ) self.execapp = self.gconf.get( "string", "execute_app", "nautilus" ) self.iconsize = self.gconf.get( "int","icon_size", 2 )