From e43a1dad804602ef51167865fdd3e2f542f2353c Mon Sep 17 00:00:00 2001 From: ankit Date: Tue, 24 Dec 2024 17:56:37 +0530 Subject: [PATCH] Fix text entry direction in object properties --- src/widgets/sp-attribute-widget.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/widgets/sp-attribute-widget.cpp b/src/widgets/sp-attribute-widget.cpp index 9a1dc01e2c..18670b3629 100644 --- a/src/widgets/sp-attribute-widget.cpp +++ b/src/widgets/sp-attribute-widget.cpp @@ -36,7 +36,12 @@ using Inkscape::UI::Syntax::SyntaxMode; void SPAttributeTable::EntryWidget::set_text(const Glib::ustring& text) { if (_entry) { + // Save cursor position + int pos = _entry->get_position(); _entry->set_text(text); + + // Restore cursor position + _entry->set_position(pos); } else { _text_view->get_buffer()->set_text(text); @@ -115,8 +120,16 @@ void SPAttributeTable::create(const std::vector& labels, const st ee->set_margin_bottom(YPAD); table->attach(*ee, 1, i, 1, 1); - ee->signal_changed().connect([i, this](){ - attribute_table_entry_changed(i); + ee->signal_changed().connect([i, ee, this](){ + if (!blocked) { + // Save cursor position + int pos = ee->get_position(); + + attribute_table_entry_changed(i); + + // Restore cursor position + ee->set_position(pos); + } }); } -- GitLab