X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d2c0a964e734283b4c3653e777e86091bd7918ef..76a6e80383f1485b4d0e11ff2c5de632e46bc36e:/src/gtk/tbargtk.cpp diff --git a/src/gtk/tbargtk.cpp b/src/gtk/tbargtk.cpp index 0802257ccc..4755e17a0e 100644 --- a/src/gtk/tbargtk.cpp +++ b/src/gtk/tbargtk.cpp @@ -184,7 +184,22 @@ static void gtk_toolbar_callback( GtkWidget *WXUNUSED(widget), } } - tbar->OnLeftClick( tool->GetId(), tool->IsToggled() ); + if( !tbar->OnLeftClick( tool->GetId(), tool->IsToggled() ) && tool->CanBeToggled() ) + { + // revert back + tool->Toggle(); + + wxBitmap bitmap = tool->GetBitmap(); + if ( bitmap.Ok() ) + { + GtkPixmap *pixmap = GTK_PIXMAP( tool->m_pixmap ); + + GdkBitmap *mask = bitmap.GetMask() ? bitmap.GetMask()->GetBitmap() + : (GdkBitmap *)NULL; + + gtk_pixmap_set( pixmap, bitmap.GetPixmap(), mask ); + } + } } //-----------------------------------------------------------------------------