From 08484739383a06e9abe4e943c9e0cddfaa21603b Mon Sep 17 00:00:00 2001 From: Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> Date: Tue, 12 Mar 2019 18:09:48 +1100 Subject: Revert Icon Preview behaviour * Fix crash on close with Icon Preview. * Force update of icons with `set`. * Set minimum width for Icon Preview's Magnified so it is not hidden on startup. Fixes https://gitlab.com/inkscape/inkscape/issues/109 --- src/ui/dialog/icon-preview.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/ui/dialog/icon-preview.cpp') diff --git a/src/ui/dialog/icon-preview.cpp b/src/ui/dialog/icon-preview.cpp index bec6298d5..175d1ca66 100644 --- a/src/ui/dialog/icon-preview.cpp +++ b/src/ui/dialog/icon-preview.cpp @@ -226,7 +226,7 @@ IconPreviewPanel::IconPreviewPanel() : } iconBox.pack_start(splitter); - splitter.pack1( *magBox, true, true ); + splitter.pack1( *magBox, true, false ); UI::Widget::Frame *actuals = Gtk::manage(new UI::Widget::Frame (_("Actual Size:"))); actuals->add(*verts); splitter.pack2( *actuals, false, false ); @@ -341,7 +341,7 @@ void IconPreviewPanel::refreshPreview() #endif //ICON_VERBOSE // Do not refresh too quickly queueRefresh(); - } else if ( desktop ) { + } else if ( desktop && desktop->doc() ) { #if ICON_VERBOSE g_message( "%s Refreshing preview.", getTimestr().c_str() ); #endif // ICON_VERBOSE @@ -641,7 +641,8 @@ void IconPreviewPanel::renderPreview( SPObject* obj ) } else { memset( pixMem[i], 0, sizes[i] * stride ); } - images[i]->queue_draw(); + images[i]->set(images[i]->get_pixbuf()); + // images[i]->queue_draw(); } updateMagnify(); @@ -658,8 +659,8 @@ void IconPreviewPanel::updateMagnify() Glib::RefPtr buf = images[hot]->get_pixbuf()->scale_simple( 128, 128, Gdk::INTERP_NEAREST ); magLabel.set_label( *labels[hot] ); magnified.set( buf ); - magnified.queue_draw(); - magnified.get_parent()->queue_draw(); + // magnified.queue_draw(); + // magnified.get_parent()->queue_draw(); } } //namespace Dialogs -- cgit v1.2.3