summaryrefslogtreecommitdiffstats
path: root/src/widgets/stroke-marker-selector.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2017-05-23 20:48:47 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2017-05-23 20:48:47 +0000
commitde37ea2c3d4a1c857186dda0b113da04cd2bd79b (patch)
tree4b52381825a1d0efcbe4cada1c4bf61ade04b6a1 /src/widgets/stroke-marker-selector.cpp
parentcmake/MSYS2: Include libyaml for xverb feature (diff)
parentselection chemistry: cancel if we hit top/bottom (diff)
downloadinkscape-de37ea2c3d4a1c857186dda0b113da04cd2bd79b.tar.gz
inkscape-de37ea2c3d4a1c857186dda0b113da04cd2bd79b.zip
merge chr[] branch : Objects panel improvements, mem leaks.
(bzr r15700)
Diffstat (limited to 'src/widgets/stroke-marker-selector.cpp')
-rw-r--r--src/widgets/stroke-marker-selector.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/widgets/stroke-marker-selector.cpp b/src/widgets/stroke-marker-selector.cpp
index b0c23a88c..3f81bef5c 100644
--- a/src/widgets/stroke-marker-selector.cpp
+++ b/src/widgets/stroke-marker-selector.cpp
@@ -54,8 +54,13 @@ MarkerComboBox::MarkerComboBox(gchar const *id, int l) :
set_cell_data_func(image_renderer, sigc::mem_fun(*this, &MarkerComboBox::prepareImageRenderer));
gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(gobj()), MarkerComboBox::separator_cb, NULL, NULL);
+ Glib::ustring no_marker("no-marker");
+ Glib::RefPtr<Gtk::IconTheme> iconTheme = Gtk::IconTheme::get_default();
+ if (!iconTheme->has_icon(no_marker)) {
+ Inkscape::queueIconPrerender( INKSCAPE_ICON(no_marker.data()), Inkscape::ICON_SIZE_SMALL_TOOLBAR );
+ }
empty_image = new Gtk::Image( Glib::wrap(
- sp_pixbuf_new( Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("no-marker") ) ) );
+ sp_pixbuf_new( Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON(no_marker.data()) ) ) );
sandbox = ink_markers_preview_doc ();
desktop = SP_ACTIVE_DESKTOP;
@@ -71,6 +76,7 @@ MarkerComboBox::MarkerComboBox(gchar const *id, int l) :
MarkerComboBox::~MarkerComboBox() {
delete combo_id;
delete sandbox;
+ delete empty_image;
if (doc) {
modified_connection.disconnect();
@@ -393,7 +399,7 @@ void MarkerComboBox::add_markers (GSList *marker_list, SPDocument *source, gbool
gchar const *markid = repr->attribute("inkscape:stockid") ? repr->attribute("inkscape:stockid") : repr->attribute("id");
// generate preview
- Gtk::Image *prv = create_marker_image (22, repr->attribute("id"), source, drawing, visionkey);
+ Gtk::Image *prv = create_marker_image (24, repr->attribute("id"), source, drawing, visionkey);
prv->show();
// Add history before separator, others after
@@ -424,14 +430,14 @@ void
MarkerComboBox::update_marker_image(gchar const *mname)
{
gchar *cache_name = g_strconcat(combo_id, mname, NULL);
- Glib::ustring key = svg_preview_cache.cache_key(doc->getURI(), cache_name, 22);
+ Glib::ustring key = svg_preview_cache.cache_key(doc->getURI(), cache_name, 24);
g_free (cache_name);
svg_preview_cache.remove_preview_from_cache(key);
Inkscape::Drawing drawing;
unsigned const visionkey = SPItem::display_key_new(1);
drawing.setRoot(sandbox->getRoot()->invoke_show(drawing, visionkey, SP_ITEM_SHOW_DISPLAY));
- Gtk::Image *prv = create_marker_image(22, mname, doc, drawing, visionkey);
+ Gtk::Image *prv = create_marker_image(24, mname, doc, drawing, visionkey);
if (prv) {
prv->show();
}