diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-06-19 14:02:40 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-07-08 21:04:13 +0000 |
| commit | 311b2f499670dfc26782357a4852a14da224eafc (patch) | |
| tree | c68d4e860ec97c8c221b0477bdff46a155c66278 /src | |
| parent | allow multiple style tags (diff) | |
| download | inkscape-311b2f499670dfc26782357a4852a14da224eafc.tar.gz inkscape-311b2f499670dfc26782357a4852a14da224eafc.zip | |
improve speed not reloading root if only one style tag
Diffstat (limited to 'src')
| -rw-r--r-- | src/inkscape.cpp | 6 | ||||
| -rw-r--r-- | src/inkscape.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/inkscape.cpp b/src/inkscape.cpp index b7d2c02c2..205707340 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -675,7 +675,7 @@ Application::add_gtk_css() } } -void Application::readStyleSheets() +void Application::readStyleSheets(bool forceupd) { SPDocument *document = SP_ACTIVE_DOCUMENT; document->setStyleSheet(nullptr); @@ -694,7 +694,9 @@ void Application::readStyleSheets() styleelem->read_content(); } } - document->getRoot()->emitModified( SP_OBJECT_MODIFIED_CASCADE ); + if (forceupd || styles.size > 1) { + document->getRoot()->emitModified( SP_OBJECT_MODIFIED_CASCADE ); + } } /** Sets the keyboard modifier to map to Alt. diff --git a/src/inkscape.h b/src/inkscape.h index cd0568f35..2f0b7ec8f 100644 --- a/src/inkscape.h +++ b/src/inkscape.h @@ -139,7 +139,7 @@ public: void selection_changed (Inkscape::Selection * selection); void subselection_changed (SPDesktop *desktop); void selection_set (Inkscape::Selection * selection); - void readStyleSheets(); + void readStyleSheets(bool forceupd = false); Glib::ustring get_symbolic_colors(); void get_higlight_colors(gchar *colornamedsuccess, gchar *colornamedwarning, gchar *colornamederror); void eventcontext_set (Inkscape::UI::Tools::ToolBase * eventcontext); |
