X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..76a6e80383f1485b4d0e11ff2c5de632e46bc36e:/src/gtk/tbargtk.cpp?ds=sidebyside diff --git a/src/gtk/tbargtk.cpp b/src/gtk/tbargtk.cpp index 496fa62618..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 ); + } + } } //----------------------------------------------------------------------------- @@ -258,6 +273,8 @@ void wxToolBar::Init() m_bg = (GdkColor *)NULL; m_toolbar = (GtkToolbar *)NULL; m_blockEvent = FALSE; + m_defaultWidth = 32; + m_defaultHeight = 32; } wxToolBar::~wxToolBar()