From: dooglus Date: Thu, 10 Apr 2008 18:43:36 +0000 (+0000) Subject: Add "select all layers" (S-C-a) and "unselect all ducks" (C-d). Move "unselect all... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7f9abbbc61efb68086aec4e1d2297694856e55f5;p=synfig.git Add "select all layers" (S-C-a) and "unselect all ducks" (C-d). Move "unselect all layers" onto S-C-d.. git-svn-id: http://svn.voria.com/code@2011 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/app.cpp b/synfig-studio/trunk/src/gtkmm/app.cpp index 3ea17a7..591d7eb 100644 --- a/synfig-studio/trunk/src/gtkmm/app.cpp +++ b/synfig-studio/trunk/src/gtkmm/app.cpp @@ -670,6 +670,8 @@ init_ui_manager() DEFINE_ACTION("copy", Gtk::StockID("gtk-copy")); DEFINE_ACTION("paste", Gtk::StockID("gtk-paste")); DEFINE_ACTION("select-all-ducks", _("Select All Ducks")); + DEFINE_ACTION("unselect-all-ducks", _("Unselect All Ducks")); + DEFINE_ACTION("select-all-layers", _("Select All Layers")); DEFINE_ACTION("unselect-all-layers", _("Unselect All Layers")); DEFINE_ACTION("properties", _("Properties")); @@ -798,8 +800,10 @@ init_ui_manager() " " " " " " -" " +" " " " +" " +" " " " " " " " @@ -938,7 +942,9 @@ init_ui_manager() } ACCEL("//select-all-ducks","a"); - ACCEL("//unselect-all-layers","d"); + ACCEL("//unselect-all-ducks","d"); + ACCEL("//select-all-layers","a"); + ACCEL("//unselect-all-layers","d"); ACCEL("//render","F9"); ACCEL("//preview","F11"); ACCEL("//properties","F8"); diff --git a/synfig-studio/trunk/src/gtkmm/canvasview.cpp b/synfig-studio/trunk/src/gtkmm/canvasview.cpp index e0f52a8..b2263f6 100644 --- a/synfig-studio/trunk/src/gtkmm/canvasview.cpp +++ b/synfig-studio/trunk/src/gtkmm/canvasview.cpp @@ -1240,6 +1240,14 @@ CanvasView::init_menus() sigc::mem_fun(*work_area,&studio::WorkArea::select_all_ducks) ); + action_group->add( Gtk::Action::create("unselect-all-ducks", _("Unselect All Ducks")), + sigc::mem_fun(*work_area,&studio::WorkArea::unselect_all_ducks) + ); + + action_group->add( Gtk::Action::create("select-all-layers", _("Select All Layers")), + sigc::mem_fun(*this,&CanvasView::on_select_layers) + ); + action_group->add( Gtk::Action::create("unselect-all-layers", _("Unselect All Layers")), sigc::mem_fun(*this,&CanvasView::on_unselect_layers) ); @@ -1520,6 +1528,8 @@ CanvasView::init_menus() // editmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("gtk-paste"),NOT_IMPLEMENTED_SLOT)); // editmenu.items().push_back(Gtk::Menu_Helpers::SeparatorElem()); // editmenu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Select All Ducks"),Gtk::AccelKey('E',Gdk::CONTROL_MASK),sigc::mem_fun(*work_area,&studio::WorkArea::select_all_ducks))); +// editmenu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Unselect All Ducks"),Gtk::AccelKey('E',Gdk::CONTROL_MASK),sigc::mem_fun(*work_area,&studio::WorkArea::unselect_all_ducks))); +// editmenu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Select All Layers"),Gtk::AccelKey('A',Gdk::CONTROL_MASK),sigc::mem_fun(*this,&CanvasView::on_select_layers))); // editmenu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Unselect All Layers"),Gtk::AccelKey('D',Gdk::CONTROL_MASK),sigc::mem_fun(*this,&CanvasView::on_unselect_layers))); // editmenu.items().push_back(Gtk::Menu_Helpers::SeparatorElem()); // @@ -1719,6 +1729,14 @@ CanvasView::init_menus() } void +CanvasView::on_select_layers() +{ + Canvas::Handle canvas(get_canvas()); + for (CanvasBase::iterator iter = canvas->begin(); iter != canvas->end(); iter++) + layer_tree->select_all_children_layers(*iter); +} + +void CanvasView::on_unselect_layers() { layer_tree->clear_selected_layers(); diff --git a/synfig-studio/trunk/src/gtkmm/canvasview.h b/synfig-studio/trunk/src/gtkmm/canvasview.h index 1fe43c6..3b27e8b 100644 --- a/synfig-studio/trunk/src/gtkmm/canvasview.h +++ b/synfig-studio/trunk/src/gtkmm/canvasview.h @@ -595,6 +595,7 @@ public: private: + void on_select_layers(); void on_unselect_layers(); void on_input_device_changed(GdkDevice*); diff --git a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp index ec99b8f..92675c8 100644 --- a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp +++ b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp @@ -282,6 +282,14 @@ Duckmatic::select_all_ducks() } void +Duckmatic::unselect_all_ducks() +{ + DuckMap::const_iterator iter; + for(iter=duck_map.begin();iter!=duck_map.end();++iter) + unselect_duck(iter->second); +} + +void Duckmatic::toggle_select_ducks_in_box(const synfig::Vector& tl,const synfig::Vector& br) { Vector vmin, vmax; diff --git a/synfig-studio/trunk/src/gtkmm/duckmatic.h b/synfig-studio/trunk/src/gtkmm/duckmatic.h index f313255..42282e0 100644 --- a/synfig-studio/trunk/src/gtkmm/duckmatic.h +++ b/synfig-studio/trunk/src/gtkmm/duckmatic.h @@ -381,6 +381,7 @@ public: Type get_type_mask()const { return type_mask; } void select_all_ducks(); + void unselect_all_ducks(); void clear_ducks();