summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/attrdialog.cpp
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2019-05-28 09:13:27 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2019-06-02 09:50:17 +0000
commit817e61de278c79c005b3970fe4acaebcda20aabb (patch)
treecd487796d3729006aac1075ac3969237348b6797 /src/ui/dialog/attrdialog.cpp
parentFixes locatesd with Thomas at Hakfest (diff)
downloadinkscape-817e61de278c79c005b3970fe4acaebcda20aabb.tar.gz
inkscape-817e61de278c79c005b3970fe4acaebcda20aabb.zip
working on selector dialog
Diffstat (limited to 'src/ui/dialog/attrdialog.cpp')
-rw-r--r--src/ui/dialog/attrdialog.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/ui/dialog/attrdialog.cpp b/src/ui/dialog/attrdialog.cpp
index ce24e3272..974a1189a 100644
--- a/src/ui/dialog/attrdialog.cpp
+++ b/src/ui/dialog/attrdialog.cpp
@@ -20,6 +20,7 @@
#include "message-stack.h"
#include "ui/icon-loader.h"
#include "ui/widget/iconrenderer.h"
+#include "style.h"
#include "xml/node-event-vector.h"
#include "xml/attribute-record.h"
@@ -280,6 +281,7 @@ void AttrDialog::onAttrDelete(Glib::ustring path)
this->_store->erase(row);
this->_repr->setAttribute(name.c_str(), nullptr, false);
this->setUndo(_("Delete attribute"));
+ reloadStyles(name);
}
}
}
@@ -308,6 +310,7 @@ bool AttrDialog::onKeyPressed(GdkEventKey *event)
this->_store->erase(row);
this->_repr->setAttribute(name.c_str(), nullptr, false);
this->setUndo(_("Delete attribute"));
+ reloadStyles(name);
}
return true;
}
@@ -363,6 +366,28 @@ void AttrDialog::nameEdited (const Glib::ustring& path, const Glib::ustring& nam
* @return
* Called when the value is edited in the TreeView editable column
*/
+void AttrDialog::reloadStyles(Glib::ustring name)
+{
+ SPDocument *document = this->_desktop->doc();
+ SPObject *obj = document->getObjectById(_repr->attribute("id"));
+ if (obj) {
+ for (auto iter : obj->style->properties()) {
+ if (iter->style_src != SP_STYLE_SRC_UNSET) {
+ if( iter->name == name) {
+ obj->style->readFromObject(obj);
+ obj->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG);
+ }
+ }
+ }
+ }
+}
+
+/**
+ * @brief AttrDialog::valueEdited
+ * @param event
+ * @return
+ * Called when the value is edited in the TreeView editable column
+ */
void AttrDialog::valueEdited (const Glib::ustring& path, const Glib::ustring& value)
{
Gtk::TreeModel::Row row = *_store->get_iter(path);
@@ -377,7 +402,8 @@ void AttrDialog::valueEdited (const Glib::ustring& path, const Glib::ustring& va
if(!value.empty()) {
row[_attrColumns._attributeValue] = value;
}
-
+ reloadStyles(name);
+
this->setUndo(_("Change attribute value"));
}
}