From: dooglus Date: Fri, 15 Feb 2008 14:39:59 +0000 (+0000) Subject: Add an "encapsulate" button to the layer dialog. Can someone design a better icon... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=464e1f22b4481c2e6a08c601ef9b4ca0531ab267;p=synfig.git Add an "encapsulate" button to the layer dialog. Can someone design a better icon for it please? git-svn-id: http://svn.voria.com/code@1700 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/images/Makefile.am b/synfig-studio/trunk/images/Makefile.am index 671cffe..88714ba 100644 --- a/synfig-studio/trunk/images/Makefile.am +++ b/synfig-studio/trunk/images/Makefile.am @@ -2,8 +2,8 @@ SYNFIG=synfig EXT=@imageext@ -EXTRA_DIST=installer_logo.sif installer_logo_osx.sif splash_screen.sif about_icon.sif angle_icon.sif bline_icon.sif blinepoint_icon.sif bool_icon.sif canvas_icon.sif canvas_pointer_icon.sif children_icon.sif circle_icon.sif clear_redo_icon.sif clear_undo_icon.sif color_icon.sif curves_icon.sif draw_icon.sif duplicate_icon.sif eyedrop_icon.sif fill_icon.sif gradient_icon.sif group_icon.sif info_icon.sif integer_icon.sif keyframe_icon.sif keyframe_lock_icon.sif layer_icon.sif list_icon.sif logo.sif meta_data_icon.sif mirror_icon.sif navigator_icon.sif normal_icon.sif pastecanvas_icon.sif polygon_icon.sif real_icon.sif rectangle_icon.sif rotate_icon.sif saveall_icon.sif scale_icon.sif segment_icon.sif sif_icon.sif sketch_icon.sif smooth_move_icon.sif string_icon.sif swap_colors_icon.sif synfig_icon.sif time_icon.sif time_track_icon.sif valuenode_icon.sif vector_icon.sif wallpaper.sif width_icon.sif zoom_icon.sif rename_icon.sif -IMAGES=installer_logo.$(EXT) installer_logo_osx.$(EXT) mirror_icon.$(EXT) time_icon.$(EXT) time_track_icon.$(EXT) curves_icon.$(EXT) pastecanvas_icon.$(EXT) group_icon.$(EXT) clear_redo_icon.$(EXT) clear_undo_icon.$(EXT) navigator_icon.$(EXT) info_icon.$(EXT) zoom_icon.$(EXT) meta_data_icon.$(EXT) children_icon.$(EXT) keyframe_icon.$(EXT) swap_colors_icon.$(EXT) rotate_icon.$(EXT) scale_icon.$(EXT) smooth_move_icon.$(EXT) width_icon.$(EXT) rectangle_icon.$(EXT) circle_icon.$(EXT) draw_icon.$(EXT) sketch_icon.$(EXT) fill_icon.$(EXT) normal_icon.$(EXT) sif_icon.$(EXT) synfig_icon.$(EXT) saveall_icon.$(EXT) bool_icon.$(EXT) integer_icon.$(EXT) angle_icon.$(EXT) segment_icon.$(EXT) blinepoint_icon.$(EXT) list_icon.$(EXT) canvas_pointer_icon.$(EXT) string_icon.$(EXT) eyedrop_icon.$(EXT) about_icon.$(EXT) splash_screen.$(EXT) canvas_icon.$(EXT) vector_icon.$(EXT) real_icon.$(EXT) color_icon.$(EXT) valuenode_icon.$(EXT) polygon_icon.$(EXT) bline_icon.$(EXT) layer_icon.$(EXT) duplicate_icon.$(EXT) gradient_icon.$(EXT) keyframe_lock_all.$(EXT) keyframe_lock_past.$(EXT) keyframe_lock_future.$(EXT) keyframe_lock_none.$(EXT) rename_icon.$(EXT) +EXTRA_DIST=installer_logo.sif installer_logo_osx.sif splash_screen.sif about_icon.sif angle_icon.sif bline_icon.sif blinepoint_icon.sif bool_icon.sif canvas_icon.sif canvas_pointer_icon.sif children_icon.sif circle_icon.sif clear_redo_icon.sif clear_undo_icon.sif color_icon.sif curves_icon.sif draw_icon.sif duplicate_icon.sif encapsulate_icon.sif eyedrop_icon.sif fill_icon.sif gradient_icon.sif group_icon.sif info_icon.sif integer_icon.sif keyframe_icon.sif keyframe_lock_icon.sif layer_icon.sif list_icon.sif logo.sif meta_data_icon.sif mirror_icon.sif navigator_icon.sif normal_icon.sif pastecanvas_icon.sif polygon_icon.sif real_icon.sif rectangle_icon.sif rotate_icon.sif saveall_icon.sif scale_icon.sif segment_icon.sif sif_icon.sif sketch_icon.sif smooth_move_icon.sif string_icon.sif swap_colors_icon.sif synfig_icon.sif time_icon.sif time_track_icon.sif valuenode_icon.sif vector_icon.sif wallpaper.sif width_icon.sif zoom_icon.sif rename_icon.sif +IMAGES=installer_logo.$(EXT) installer_logo_osx.$(EXT) mirror_icon.$(EXT) time_icon.$(EXT) time_track_icon.$(EXT) curves_icon.$(EXT) pastecanvas_icon.$(EXT) group_icon.$(EXT) clear_redo_icon.$(EXT) clear_undo_icon.$(EXT) navigator_icon.$(EXT) info_icon.$(EXT) zoom_icon.$(EXT) meta_data_icon.$(EXT) children_icon.$(EXT) keyframe_icon.$(EXT) swap_colors_icon.$(EXT) rotate_icon.$(EXT) scale_icon.$(EXT) smooth_move_icon.$(EXT) width_icon.$(EXT) rectangle_icon.$(EXT) circle_icon.$(EXT) draw_icon.$(EXT) sketch_icon.$(EXT) fill_icon.$(EXT) normal_icon.$(EXT) sif_icon.$(EXT) synfig_icon.$(EXT) saveall_icon.$(EXT) bool_icon.$(EXT) integer_icon.$(EXT) angle_icon.$(EXT) segment_icon.$(EXT) blinepoint_icon.$(EXT) list_icon.$(EXT) canvas_pointer_icon.$(EXT) string_icon.$(EXT) eyedrop_icon.$(EXT) about_icon.$(EXT) splash_screen.$(EXT) canvas_icon.$(EXT) vector_icon.$(EXT) real_icon.$(EXT) color_icon.$(EXT) valuenode_icon.$(EXT) polygon_icon.$(EXT) bline_icon.$(EXT) layer_icon.$(EXT) duplicate_icon.$(EXT) encapsulate_icon.$(EXT) gradient_icon.$(EXT) keyframe_lock_all.$(EXT) keyframe_lock_past.$(EXT) keyframe_lock_future.$(EXT) keyframe_lock_none.$(EXT) rename_icon.$(EXT) MAINTAINERCLEANFILES=Makefile.in CLEANFILES=$(IMAGES) images.nsh unimages.nsh installer_logo.bmp sif_icon.ico synfig_icon.ico icons.nsh unicons.nsh diff --git a/synfig-studio/trunk/images/encapsulate_icon.sif b/synfig-studio/trunk/images/encapsulate_icon.sif new file mode 100644 index 0000000..3b4ce89 --- /dev/null +++ b/synfig-studio/trunk/images/encapsulate_icon.sif @@ -0,0 +1,438 @@ + + + Untitled1 + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + 0.1000000015 + -0.1000000015 + + + + + + + + + + + + + + + + + + + + + + -0.4000000060 + 0.4000000060 + + + + + -0.4000000060 + -0.4000000060 + + + + + 0.4000000060 + -0.4000000060 + + + + + 0.4000000060 + 0.4000000060 + + + + + + + + + + + + + + + + + + 0.1000000015 + 0.1000000015 + + + + + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + 0.0000000000 + 0.0000000000 + + + + + + + + + + + + + + + + + + + + + + -0.4000000060 + 0.4000000060 + + + + + -0.4000000060 + -0.4000000060 + + + + + 0.4000000060 + -0.4000000060 + + + + + 0.4000000060 + 0.4000000060 + + + + + + + + + + + + + + + + + + 1.000000 + 0.900000 + 0.600000 + 1.000000 + + + + + 0.0000000000 + 0.0000000000 + + + + + + + + + + + + + + + + + + + + + + -0.3000000119 + 0.3000000119 + + + + + -0.3000000119 + -0.3000000119 + + + + + 0.3000000119 + -0.3000000119 + + + + + 0.3000000119 + 0.3000000119 + + + + + + + + + + + + + + + + + + + + 0.5312500000 + -0.5312500000 + + + + + + + + + + + + + + + + + + + + + 0.0937500000 + 0.5781250000 + + + + + + + + + + + + + + + + + + + + + -0.2500000000 + 0.4062500000 + + + + + + + + + + + + + + + + + + + + + -0.5625000000 + 0.1718750000 + + + + + + + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + 0.0000000000 + 0.0000000000 + + + + + + + + + + + + + + + + + + + + + + -0.6374999881 + -0.2781249881 + + + + + -0.4375000000 + -0.2781249881 + + + + + -0.4375000000 + -0.5781250000 + + + + + -0.2374999821 + -0.5781250000 + + + + + -0.2374999821 + -0.3781249821 + + + + + 0.0625000224 + -0.6781249642 + + + + + -0.2374999821 + -0.9781249762 + + + + + -0.2374999821 + -0.7781249881 + + + + + -0.6374999881 + -0.7781249881 + + + + + + diff --git a/synfig-studio/trunk/src/gtkmm/dock_layers.cpp b/synfig-studio/trunk/src/gtkmm/dock_layers.cpp index e2abf52..12bbe0f 100644 --- a/synfig-studio/trunk/src/gtkmm/dock_layers.cpp +++ b/synfig-studio/trunk/src/gtkmm/dock_layers.cpp @@ -151,6 +151,7 @@ Dock_Layers::Dock_Layers(): " " " " " " + " " " " " " " " diff --git a/synfig-studio/trunk/src/gtkmm/iconcontroller.cpp b/synfig-studio/trunk/src/gtkmm/iconcontroller.cpp index 1c1ed59..843b064 100644 --- a/synfig-studio/trunk/src/gtkmm/iconcontroller.cpp +++ b/synfig-studio/trunk/src/gtkmm/iconcontroller.cpp @@ -162,6 +162,7 @@ IconController::IconController(const synfig::String& /*basepath*/) INIT_STOCK_ICON(grid_snap_enable,"grid_snap_enable_icon."IMAGE_EXT,_("Enable Grid Snap")); INIT_STOCK_ICON(grid_snap_disable,"grid_snap_disable_icon."IMAGE_EXT,_("Disable Grid Snap")); INIT_STOCK_ICON(duplicate,"duplicate_icon."IMAGE_EXT,_("Duplicate")); + INIT_STOCK_ICON(encapsulate,"encapsulate_icon."IMAGE_EXT,_("Encapsulate")); INIT_STOCK_ICON(clear_undo,"clear_undo_icon."IMAGE_EXT,_("Clear Undo Stack")); INIT_STOCK_ICON(clear_redo,"clear_redo_icon."IMAGE_EXT,_("Clear Redo Stack")); diff --git a/synfig-studio/trunk/src/gtkmm/layertree.cpp b/synfig-studio/trunk/src/gtkmm/layertree.cpp index ab05c82..a5cd795 100644 --- a/synfig-studio/trunk/src/gtkmm/layertree.cpp +++ b/synfig-studio/trunk/src/gtkmm/layertree.cpp @@ -126,21 +126,25 @@ LayerTree::LayerTree(): SMALL_BUTTON(button_raise,"gtk-go-up","Raise"); SMALL_BUTTON(button_lower,"gtk-go-down","Lower"); SMALL_BUTTON(button_duplicate,"synfig-duplicate","Duplicate"); + SMALL_BUTTON(button_encapsulate,"synfig-encapsulate","Encapsulate"); SMALL_BUTTON(button_delete,"gtk-delete","Delete"); hbox->pack_start(*button_raise,Gtk::PACK_SHRINK); hbox->pack_start(*button_lower,Gtk::PACK_SHRINK); hbox->pack_start(*button_duplicate,Gtk::PACK_SHRINK); + hbox->pack_start(*button_encapsulate,Gtk::PACK_SHRINK); hbox->pack_start(*button_delete,Gtk::PACK_SHRINK); button_raise->signal_clicked().connect(sigc::mem_fun(*this, &studio::LayerTree::on_raise_pressed)); button_lower->signal_clicked().connect(sigc::mem_fun(*this, &studio::LayerTree::on_lower_pressed)); button_duplicate->signal_clicked().connect(sigc::mem_fun(*this, &studio::LayerTree::on_duplicate_pressed)); + button_encapsulate->signal_clicked().connect(sigc::mem_fun(*this, &studio::LayerTree::on_encapsulate_pressed)); button_delete->signal_clicked().connect(sigc::mem_fun(*this, &studio::LayerTree::on_delete_pressed)); button_raise->set_sensitive(false); button_lower->set_sensitive(false); button_duplicate->set_sensitive(false); + button_encapsulate->set_sensitive(false); button_delete->set_sensitive(false); get_selection()->signal_changed().connect(sigc::mem_fun(*this, &studio::LayerTree::on_selection_changed)); @@ -618,6 +622,7 @@ LayerTree::on_selection_changed() button_raise->set_sensitive(false); button_lower->set_sensitive(false); button_duplicate->set_sensitive(false); + button_encapsulate->set_sensitive(false); button_delete->set_sensitive(false); layer_amount_hscale->set_sensitive(false); blend_method_widget.set_sensitive(false); @@ -627,6 +632,7 @@ LayerTree::on_selection_changed() button_raise->set_sensitive(true); button_lower->set_sensitive(true); button_duplicate->set_sensitive(true); + button_encapsulate->set_sensitive(true); button_delete->set_sensitive(true); if(layer_list.size()==1 && (*layer_list.begin())->get_param("amount").is_valid()&& (*layer_list.begin())->get_param("amount").same_type_as(Real())) @@ -1023,6 +1029,27 @@ LayerTree::on_duplicate_pressed() } void +LayerTree::on_encapsulate_pressed() +{ + synfigapp::Action::ParamList param_list; + param_list.add("time",layer_tree_store_->canvas_interface()->get_time()); + param_list.add("canvas",layer_tree_store_->canvas_interface()->get_canvas()); + param_list.add("canvas_interface",layer_tree_store_->canvas_interface()); + + { + synfigapp::SelectionManager::LayerList layer_list(get_selection_manager()->get_selected_layers()); + synfigapp::SelectionManager::LayerList::iterator iter; + + for(iter=layer_list.begin();iter!=layer_list.end();++iter) + param_list.add("layer",Layer::Handle(*iter)); + } + + synfigapp::Action::Handle action(synfigapp::Action::create("layer_encapsulate")); + action->set_param_list(param_list); + layer_tree_store_->canvas_interface()->get_instance()->perform_action(action); +} + +void LayerTree::on_delete_pressed() { synfigapp::Action::ParamList param_list; diff --git a/synfig-studio/trunk/src/gtkmm/layertree.h b/synfig-studio/trunk/src/gtkmm/layertree.h index 95094fa..de02473 100644 --- a/synfig-studio/trunk/src/gtkmm/layertree.h +++ b/synfig-studio/trunk/src/gtkmm/layertree.h @@ -146,6 +146,7 @@ private: Gtk::Button *button_raise; Gtk::Button *button_lower; Gtk::Button *button_duplicate; + Gtk::Button *button_encapsulate; Gtk::Button *button_delete; Widget_ValueBase blend_method_widget; @@ -195,6 +196,8 @@ public: void on_duplicate_pressed(); + void on_encapsulate_pressed(); + void on_delete_pressed(); /*