# vbox = gtk.VBox()
# vbox.pack_start(gtk.HSeparator(), expand=False)
- add_button = stock_button(gtk.STOCK_ADD)
- add_button.connect('clicked', self.on_layer_add)
- del_button = stock_button(gtk.STOCK_DELETE)
- del_button.connect('clicked', self.on_layer_del)
-
# Widgets
self.visibility_button = Eye()
self.visibility_button.on_toggle = self.on_visibility_toggled
self.main_hbox = gtk.HBox()
self.main_hbox.pack_start(self.visibility_button, expand=False)
self.main_hbox.pack_start(layer_name_box)
- self.main_hbox.pack_start(add_button, expand=False)
- self.main_hbox.pack_start(del_button, expand=False)
self.add(self.main_hbox)
# Drag/drop for moving layers
selection.set(selection.target, 8, str(idx))
elif targetType==DRAG_LAYER_PNG:
pixbuf = self.layer.surface.render_as_pixbuf()
- pixbuf.save_to_callback(stringIO_saver, 'png', {'aplha':'True'})
+ pixbuf.save_to_callback(stringIO_saver, 'png', {'alpha':'True'})
s = tmp.getvalue()
selection.set(selection.target, 8, s)
elif targetType==DRAG_LAYER_URI:
self.layer_name.set_text(layer.name)
self.callbacks_active = True
- def on_layer_add(self,button):
- doc = self.app.drawWindow.tdw.doc
- doc.add_layer(after=self.layer)
-
- def on_layer_del(self,button):
- doc = self.app.drawWindow.tdw.doc
- doc.remove_layer(layer=self.layer)
-
def change_name(self, *ignore):
layer_name = dialogs.ask_for_name(self, _("Layer name"), "New Layer")
if layer_name:
opacity_hbox.pack_start(opacity_lbl, expand=False)
opacity_hbox.pack_start(self.opacity_scale, expand=True)
+
+ buttons_hbox = gtk.HBox()
+ add_button = stock_button(gtk.STOCK_ADD)
+ add_button.connect('clicked', self.on_layer_add)
+ del_button = stock_button(gtk.STOCK_DELETE)
+ del_button.connect('clicked', self.on_layer_del)
+
move_up_button = stock_button(gtk.STOCK_GO_UP)
move_down_button = stock_button(gtk.STOCK_GO_DOWN)
- buttons_hbox = gtk.HBox()
- buttons_hbox.pack_start(move_up_button)
- buttons_hbox.pack_start(move_down_button)
move_up_button.connect('clicked', self.move_layer, 'up')
move_down_button.connect('clicked', self.move_layer, 'down')
+ buttons_hbox.pack_start(add_button)
+ buttons_hbox.pack_start(move_up_button)
+ buttons_hbox.pack_start(move_down_button)
+ buttons_hbox.pack_start(del_button)
+
+
# Pack and add to toplevel
vbox = gtk.VBox()
vbox.pack_start(layers_scroll)
doc.move_layer(current_layer_pos, new_layer_pos)
doc.select_layer(new_layer_pos)
+ def on_layer_add(self,button):
+ doc = self.app.drawWindow.tdw.doc
+ doc.add_layer(after=doc.get_current_layer())
+
+ def on_layer_del(self,button):
+ doc = self.app.drawWindow.tdw.doc
+ doc.remove_layer(layer=doc.get_current_layer())