Some minor fixes and tweaks
[jamaendo] / jamaui / listbox.py
index bc34d09..dad31ef 100644 (file)
@@ -2,8 +2,10 @@
 import gtk
 try:
     import hildon
+    _using_helldon = False
 except:
     import helldon as hildon
+    _using_helldon = True
 
 class ListBox(gtk.TreeView):
     def __init__(self):
@@ -42,11 +44,11 @@ class ListBox(gtk.TreeView):
 
 class ListDialog(gtk.Dialog):
     def __init__(self, title, parent=None):
-        gtk.Dialog.__init__(self, title, parent)
+        gtk.Dialog.__init__(self, title, parent if not _using_helldon else None)
         self.listbox = ListBox()
         panarea = hildon.PannableArea()
         panarea.add(self.listbox)
-        panarea.set_size_request(800, 300)
+        panarea.set_size_request_policy(hildon.SIZE_REQUEST_CHILDREN)
         self.vbox.pack_start(panarea, True, True, 0)
 
         self.selected = None
@@ -59,7 +61,7 @@ class ListDialog(gtk.Dialog):
 
 class ButtonListDialog(gtk.Dialog):
     def __init__(self, title, parent=None):
-        gtk.Dialog.__init__(self, title, parent)
+        gtk.Dialog.__init__(self, title, parent if not _using_helldon else None)
         self.panarea = hildon.PannableArea()
         self.panarea.set_size_request(800, 400)
         self.buttons = gtk.VBox(False, 0)
@@ -67,8 +69,9 @@ class ButtonListDialog(gtk.Dialog):
         self.vbox.pack_start(self.panarea, True, True, 0)
 
     def add_button(self, label, clickcb, *args):
-        btn = hildon.Button(gtk.HILDON_SIZE_AUTO_WIDTH|gtk.HILDON_SIZE_FINGER_HEIGHT, hildon.BUTTON_ARRANGEMENT_VERTICAL)
+        btn = hildon.Button(gtk.HILDON_SIZE_AUTO_WIDTH|gtk.HILDON_SIZE_FINGER_HEIGHT,
+                            hildon.BUTTON_ARRANGEMENT_VERTICAL)
         btn.set_label(label)
         btn.connect('clicked', clickcb, *args)
-        self.buttons.pack_end(btn, False, False, 0)
+        self.buttons.pack_start(btn, False, False, 0)