Ability to disable scrollbar for/autoresize Places

This commit is contained in:
clhodapp 2009-10-09 13:32:23 -05:00
parent 5870921679
commit d3a96e305e
4 changed files with 34 additions and 12 deletions

View File

@ -837,6 +837,18 @@
<widget class="GtkVBox" id="vbox2"> <widget class="GtkVBox" id="vbox2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<child>
<widget class="GtkCheckButton" id="allowscrollbarcheckbutton">
<property name="label" translatable="yes">Allow Scrollbar</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<widget class="GtkAlignment" id="alignment5"> <widget class="GtkAlignment" id="alignment5">
<property name="visible">True</property> <property name="visible">True</property>
@ -878,7 +890,7 @@
</widget> </widget>
<packing> <packing>
<property name="padding">4</property> <property name="padding">4</property>
<property name="position">0</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -974,7 +986,7 @@
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="position">1</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -1134,7 +1146,7 @@
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="position">3</property> <property name="position">4</property>
</packing> </packing>
</child> </child>
</widget> </widget>

View File

@ -122,6 +122,7 @@ class mintMenuConfig( object ):
self.desktoptoggle = wTree.get_widget( "desktopcheckbutton" ) self.desktoptoggle = wTree.get_widget( "desktopcheckbutton" )
self.trashtoggle = wTree.get_widget( "trashcheckbutton" ) self.trashtoggle = wTree.get_widget( "trashcheckbutton" )
self.customplacestree = wTree.get_widget( "customplacestree" ) self.customplacestree = wTree.get_widget( "customplacestree" )
self.allowScrollbarToggle = wTree.get_widget( "allowscrollbarcheckbutton" )
self.placesHeightBox = wTree.get_widget( "placesHeightSpinBox" ) self.placesHeightBox = wTree.get_widget( "placesHeightSpinBox" )
wTree.get_widget( "closeButton" ).connect("clicked", gtk.main_quit ) 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_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, "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, "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.customplacenames = self.gconfPlaces.get( "list-string", "custom_names", [ ] )
self.customplacepaths = self.gconfPlaces.get( "list-string", "custom_paths", [ ] ) self.customplacepaths = self.gconfPlaces.get( "list-string", "custom_paths", [ ] )

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--*- mode: xml -*-->
<glade-interface> <glade-interface>
<!-- interface-requires gtk+ 2.16 -->
<!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkWindow" id="mainWindow"> <widget class="GtkWindow" id="mainWindow">
<signal name="destroy" handler="on_window1_destroy"/> <signal name="destroy" handler="on_window1_destroy"/>
<child> <child>
@ -11,15 +11,15 @@
<widget class="GtkScrolledWindow" id="scrolledwindow2"> <widget class="GtkScrolledWindow" id="scrolledwindow2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> <property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> <property name="vscrollbar_policy">automatic</property>
<signal name="drag_motion" handler="on_scrolledwindow_drag_motion"/> <signal name="drag_motion" handler="on_scrolledwindow_drag_motion"/>
<signal name="drag_drop" handler="on_scrolledwindow_drag_drop"/> <signal name="drag_drop" handler="on_scrolledwindow_drag_drop"/>
<signal name="drag_data_received" handler="on_scrolledwindow_drag_data_received"/> <signal name="drag_data_received" handler="on_scrolledwindow_drag_data_received"/>
<child> <child>
<widget class="GtkViewport" id="viewport2"> <widget class="GtkViewport" id="viewport2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="shadow_type">GTK_SHADOW_NONE</property> <property name="shadow_type">none</property>
<child> <child>
<widget class="GtkVBox" id="vbox1"> <widget class="GtkVBox" id="vbox1">
<property name="visible">True</property> <property name="visible">True</property>
@ -29,11 +29,14 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">2</property> <property name="spacing">2</property>
</widget> </widget>
<packing>
<property name="position">0</property>
</packing>
</child> </child>
<child> <child>
<widget class="GtkVButtonBox" id="editable_button_holder"> <widget class="GtkVButtonBox" id="editable_button_holder">
<property name="visible">True</property> <property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_START</property> <property name="layout_style">start</property>
</widget> </widget>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>

View File

@ -30,7 +30,7 @@ class pluginclass( object ):
wTree = gtk.glade.XML( gladefile, "mainWindow" ) wTree = gtk.glade.XML( gladefile, "mainWindow" )
self.placesBtnHolder = wTree.get_widget( "places_button_holder" ) self.placesBtnHolder = wTree.get_widget( "places_button_holder" )
self.editableBtnHolder = wTree.get_widget( "editable_button_holder" ) self.editableBtnHolder = wTree.get_widget( "editable_button_holder" )
self.scrolledWindow=wTree.get_widget("scrolledwindow2")
# These properties are NECESSARY to maintain consistency # These properties are NECESSARY to maintain consistency
# Set 'window' property for the plugin (Must be the root widget) # Set 'window' property for the plugin (Must be the root widget)
@ -82,6 +82,11 @@ 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", 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.height = self.gconf.get( "int", "height", 155 )
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", 2 ) self.iconsize = self.gconf.get( "int","icon_size", 2 )