From: dooglus Date: Tue, 29 Jan 2008 10:57:06 +0000 (+0000) Subject: Allow the layer panel to be sorted by layer name. Resize the layer name column to... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=4911086b527a3419a3e40488d7e17339f0a4f18e;p=synfig.git Allow the layer panel to be sorted by layer name. Resize the layer name column to fit the layer names. Rename the "Layer" column to "Name". git-svn-id: http://svn.voria.com/code@1522 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/layertree.cpp b/synfig-studio/trunk/src/gtkmm/layertree.cpp index 211e97e..bc78ace 100644 --- a/synfig-studio/trunk/src/gtkmm/layertree.cpp +++ b/synfig-studio/trunk/src/gtkmm/layertree.cpp @@ -208,27 +208,27 @@ LayerTree::create_layer_tree() } //get_layer_tree_view().append_column(_("Z"),layer_model.z_depth); { // --- N A M E -------------------------------------------------------- - Gtk::TreeView::Column* column = Gtk::manage( new Gtk::TreeView::Column(_("Layer")) ); + Gtk::TreeView::Column* column = Gtk::manage( new Gtk::TreeView::Column(_("Name")) ); // Set up the icon cell-renderer Gtk::CellRendererText* cellrenderer = Gtk::manage( new Gtk::CellRendererText() ); + column->pack_start(*cellrenderer,false); + column->add_attribute(cellrenderer->property_text(), layer_model.label); cellrenderer->signal_edited().connect(sigc::mem_fun(*this, &studio::LayerTree::on_layer_renamed)); cellrenderer->property_editable()=true; - column->pack_start(*cellrenderer,false); - column->add_attribute(cellrenderer->property_text(), layer_model.label); + column->set_reorderable(); + // column->set_resizable(); + column->set_clickable(true); + column->set_sort_column(layer_model.label); + get_layer_tree_view().append_column(*column); // int index; // index=get_layer_tree_view().append_column_editable(_("Layer"),layer_model.label); //Gtk::TreeView::Column* column = get_layer_tree_view().get_column(index-1); - //column->set_sort_column(layer_model.index); - //get_layer_tree_view().set_expander_column(*column); - //column->set_reorderable(); - //column->set_resizable(); - //column->set_clickable(false); //Gtk::CellRendererPixbuf* icon_cellrenderer = Gtk::manage( new Gtk::CellRendererPixbuf() ); //column->pack_start(*icon_cellrenderer,false); @@ -707,6 +707,7 @@ LayerTree::on_layer_renamed(const Glib::ustring&path_string,const Glib::ustring& if(!row) return; row[layer_model.label]=value; + get_layer_tree_view().columns_autosize(); } void