summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2008-09-18 07:38:48 +0000
committerjoncruz <joncruz@users.sourceforge.net>2008-09-18 07:38:48 +0000
commitedf7ac4d7a4d5bb9cd5dac9dbb3a5616b399ef1c (patch)
tree33bc1d72a8a2533fb2fcdb5950c7265874a3752a /src
parentFixed initialization order issue (diff)
downloadinkscape-edf7ac4d7a4d5bb9cd5dac9dbb3a5616b399ef1c.tar.gz
inkscape-edf7ac4d7a4d5bb9cd5dac9dbb3a5616b399ef1c.zip
Fix prerender shortcut by size. Fixes bug #262916.
(bzr r6834)
Diffstat (limited to 'src')
-rw-r--r--src/widgets/icon.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp
index 41c4ca5df..f9e4bf941 100644
--- a/src/widgets/icon.cpp
+++ b/src/widgets/icon.cpp
@@ -319,12 +319,15 @@ sp_icon_new_full( Inkscape::IconSize lsize, gchar const *name )
addPreRender( lsize, name );
// Add a hook to render if set visible before prerender is done.
- g_signal_connect( G_OBJECT(img), "map", G_CALLBACK(imageMapCB), GINT_TO_POINTER(0) );
+ g_signal_connect( G_OBJECT(img), "map", G_CALLBACK(imageMapCB), GINT_TO_POINTER(static_cast<int>(lsize)) );
+ if ( dump ) {
+ g_message(" connecting %p for imageMapCB for [%s] %d", img, name, (int)lsize);
+ }
}
widget = GTK_WIDGET(img);
img = 0;
if ( dump ) {
- g_message( "loaded gtk '%s' %d (GTK_IMAGE_STOCK) %s", name, lsize, (stockFound ? "STOCK" : "local") );
+ g_message( "loaded gtk '%s' %d (GTK_IMAGE_STOCK) %s on %p", name, lsize, (stockFound ? "STOCK" : "local"), widget );
}
} else if ( type == GTK_IMAGE_ICON_NAME ) {
widget = GTK_WIDGET(img);
@@ -1068,12 +1071,15 @@ void imageMapCB(GtkWidget* widget, gpointer user_data) {
gchar* id = 0;
GtkIconSize size = GTK_ICON_SIZE_INVALID;
gtk_image_get_stock(GTK_IMAGE(widget), &id, &size);
+ int lsize = GPOINTER_TO_INT(user_data);
if ( id ) {
+ int psize = sp_icon_get_phys_size(lsize);
+ //g_message("imageMapCB(%p) for %s:%d:%d", widget, id, lsize, psize);
for ( std::vector<preRenderItem>::iterator it = pendingRenders.begin(); it != pendingRenders.end(); ++it ) {
- if ( (it->_name == id) && (it->_lsize == static_cast<Inkscape::IconSize>(size)) ) {
- int psize = sp_icon_get_phys_size(size);
- prerender_icon(id, size, psize);
+ if ( (it->_name == id) && (it->_lsize == static_cast<Inkscape::IconSize>(lsize)) ) {
+ prerender_icon(id, lsize, psize);
pendingRenders.erase(it);
+ //g_message(" prerender for %s:%d:%d", id, lsize, psize);
break;
}
}