summaryrefslogtreecommitdiffstats
path: root/src/widgets/stroke-marker-selector.cpp
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2012-08-07 13:35:25 +0000
committerJohn Smith <john.smith7545@yahoo.com>2012-08-07 13:35:25 +0000
commitfb1922ef1875bd9eef376ed51a892516bc3df274 (patch)
treedcdf829ca4b7421fb029baf5cc5d39092727b5f2 /src/widgets/stroke-marker-selector.cpp
parentFix for 427514 : Filter effects dialog data mirroring (diff)
downloadinkscape-fb1922ef1875bd9eef376ed51a892516bc3df274.tar.gz
inkscape-fb1922ef1875bd9eef376ed51a892516bc3df274.zip
Fix for 1030239 : Custom markers only added to the list in 'Fill and Stroke - Style' after reloading the file : Fix selection regression
(bzr r11597)
Diffstat (limited to 'src/widgets/stroke-marker-selector.cpp')
-rw-r--r--src/widgets/stroke-marker-selector.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/widgets/stroke-marker-selector.cpp b/src/widgets/stroke-marker-selector.cpp
index ccefdf53e..cada81f7b 100644
--- a/src/widgets/stroke-marker-selector.cpp
+++ b/src/widgets/stroke-marker-selector.cpp
@@ -46,7 +46,8 @@ static Inkscape::UI::Cache::SvgPreview svg_preview_cache;
MarkerComboBox::MarkerComboBox(gchar const *id) :
Gtk::ComboBox(),
combo_id(id),
- updating(false)
+ updating(false),
+ markerCount(0)
{
marker_store = Gtk::ListStore::create(marker_columns);
@@ -113,9 +114,23 @@ MarkerComboBox::refreshHistory()
return;
updating = true;
- const char *active = get_active()->get_value(marker_columns.marker);
- sp_marker_list_from_doc(doc, true);
- set_selected(active);
+
+ GSList *ml = get_marker_list(doc);
+
+ /*
+ * Seems to be no way to get notified of changes just to markers,
+ * so listen to changes in all defs and check if the number of markers has changed here
+ * to avoid unnecessary refreshes when things like gradients change
+ */
+ if (markerCount != g_slist_length(ml)) {
+ const char *active = get_active()->get_value(marker_columns.marker);
+ sp_marker_list_from_doc(doc, true);
+ set_selected(active);
+ markerCount = g_slist_length(ml);
+ }
+
+ g_slist_free (ml);
+
updating = false;
}