diff options
Diffstat (limited to 'ptgui.py')
-rw-r--r-- | ptgui.py | 38 |
1 files changed, 32 insertions, 6 deletions
@@ -20,7 +20,9 @@ class MainWindow(object): self.wnd = builder.get_object('mainwnd') self.wnd.connect("delete-event", Gtk.main_quit) self.statuslabel = builder.get_object('statuslabel') - self.ctlgrid = builder.get_object('ctlgrid') + tabviewport = builder.get_object('tabviewport') + self.ctlgrid = Gtk.Table() + tabviewport.add(self.ctlgrid) self.printbtn = builder.get_object('printbtn') self.color_fg = builder.get_object('color_fg') self.color_bg = builder.get_object('color_bg') @@ -209,14 +211,38 @@ class MainWindow(object): def layout_put_controls(self): nodes = [self.layout] + rows = -1 while len(nodes) > 0: + rows += 1 # separator node = nodes.pop(0) - nodes.extend(reversed(node.children())) - for p in reversed(node.properties()): + nodes.extend(node.children()) + for p in node.properties(): + rows += 1 + + self.ctlgrid.resize(rows, 2) + + nodes = [self.layout] + row = 0 + first = True + while len(nodes) > 0: + if not first: + hs = Gtk.HSeparator() + self.ctlgrid.attach(hs, 0, 2, row, row + 1, ypadding = 3.0, + xoptions = Gtk.AttachOptions.FILL | Gtk.AttachOptions.EXPAND, yoptions = 0) + row += 1 + first = False + + node = nodes.pop(0) + nodes.extend(node.children()) + for p in node.properties(): elem = self.layout_control(node, p[0], p[1]) - self.ctlgrid.insert_row(0) - self.ctlgrid.attach(Gtk.Label(p[0]), 0, 0, 1, 1) - self.ctlgrid.attach(elem, 1, 0, 1, 1) + lbl = Gtk.Label(p[0]) + lbl.set_alignment(0.0, 0.5) + self.ctlgrid.attach(lbl, 0, 1, row, row + 1, + xoptions = Gtk.AttachOptions.FILL, yoptions = 0) + self.ctlgrid.attach(elem, 1, 2, row, row + 1, + xoptions = Gtk.AttachOptions.FILL | Gtk.AttachOptions.EXPAND, yoptions = 0) + row += 1 def on_print(self, *args): if self.label_surface is None: |