diff options
| author | Martin Owens <doctormo@gmail.com> | 2018-09-11 06:18:20 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2018-09-11 06:18:20 +0000 |
| commit | 4181d575dc6e31a2f8485358d7bcc9ad1c68e358 (patch) | |
| tree | 503413bae6fc54d2522fffc639e0c2f3d1d0042d /src/ui/dialog/layers.cpp | |
| parent | Merge branch 'mason1920/inkscape-patch-1' (diff) | |
| download | inkscape-4181d575dc6e31a2f8485358d7bcc9ad1c68e358.tar.gz inkscape-4181d575dc6e31a2f8485358d7bcc9ad1c68e358.zip | |
Remove the custom handling of column editability, that is not how to do it.
Diffstat (limited to 'src/ui/dialog/layers.cpp')
| -rw-r--r-- | src/ui/dialog/layers.cpp | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp index bfd0e05e3..a749c322c 100644 --- a/src/ui/dialog/layers.cpp +++ b/src/ui/dialog/layers.cpp @@ -544,28 +544,6 @@ void LayersPanel::_toggled( Glib::ustring const& str, int targetCol ) Inkscape::SelectionHelper::fixSelection(_desktop); } -bool LayersPanel::_handleKeyEvent(GdkEventKey *event) -{ - - switch (Inkscape::UI::Tools::get_latin_keyval(event)) { - case GDK_KEY_Return: - case GDK_KEY_KP_Enter: - case GDK_KEY_F2: { - Gtk::TreeModel::iterator iter = _tree.get_selection()->get_selected(); - if (iter && !_text_renderer->property_editable()) { - Gtk::TreeModel::Path *path = new Gtk::TreeModel::Path(iter); - // Edit the layer label - _text_renderer->property_editable() = true; - _tree.set_cursor(*path, *_name_column, true); - grab_focus(); - return true; - } - } - break; - } - return false; -} - bool LayersPanel::_handleButtonEvent(GdkEventButton* event) { static unsigned doubleclick = 0; @@ -644,22 +622,6 @@ bool LayersPanel::_handleButtonEvent(GdkEventButton* event) doubleclick = 1; } - if ( event->type == GDK_BUTTON_RELEASE && doubleclick) { - doubleclick = 0; - Gtk::TreeModel::Path path; - Gtk::TreeViewColumn* col = nullptr; - int x = static_cast<int>(event->x); - int y = static_cast<int>(event->y); - int x2 = 0; - int y2 = 0; - if ( _tree.get_path_at_pos( x, y, path, col, x2, y2 ) && col == _name_column) { - // Double click on the Layer name, enable editing - _text_renderer->property_editable() = true; - _tree.set_cursor (path, *_name_column, true); - grab_focus(); - } - } - return false; } @@ -746,12 +708,6 @@ void LayersPanel::_handleEdited(const Glib::ustring& path, const Glib::ustring& Gtk::TreeModel::Row row = *iter; _renameLayer(row, new_text); - _text_renderer->property_editable() = false; -} - -void LayersPanel::_handleEditingCancelled() -{ - _text_renderer->property_editable() = false; } void LayersPanel::_renameLayer(Gtk::TreeModel::Row row, const Glib::ustring& name) @@ -866,12 +822,11 @@ LayersPanel::LayersPanel() : _tree.signal_drag_drop().connect( sigc::mem_fun(*this, &LayersPanel::_handleDragDrop), false); + _text_renderer->property_editable() = true; _text_renderer->signal_edited().connect( sigc::mem_fun(*this, &LayersPanel::_handleEdited) ); - _text_renderer->signal_editing_canceled().connect( sigc::mem_fun(*this, &LayersPanel::_handleEditingCancelled) ); _tree.signal_button_press_event().connect( sigc::mem_fun(*this, &LayersPanel::_handleButtonEvent), false ); _tree.signal_button_release_event().connect( sigc::mem_fun(*this, &LayersPanel::_handleButtonEvent), false ); - _tree.signal_key_press_event().connect( sigc::mem_fun(*this, &LayersPanel::_handleKeyEvent), false ); _scroller.add( _tree ); _scroller.set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC ); |
