X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f03fc89fff2d6e823e7d4d14fbe14822ad6777b1..f2fe5464d6c8d178aa5733cf078ed5988ec90721:/src/gtk/tbargtk.cpp diff --git a/src/gtk/tbargtk.cpp b/src/gtk/tbargtk.cpp index 16a897245a..de244c82b1 100644 --- a/src/gtk/tbargtk.cpp +++ b/src/gtk/tbargtk.cpp @@ -42,7 +42,23 @@ static void gtk_toolbar_callback( GtkWidget *WXUNUSED(widget), wxToolBarTool *to if (g_blockEventsOnDrag) return; if (!tool->m_enabled) return; - if (tool->m_isToggle) tool->m_toggleState = !tool->m_toggleState; + if (tool->m_isToggle) + { + tool->m_toggleState = !tool->m_toggleState; + + if (tool->m_bitmap2.Ok()) + { + wxBitmap bitmap = tool->m_bitmap1; + if (tool->m_toggleState) bitmap = tool->m_bitmap2; + + GtkPixmap *pixmap = GTK_PIXMAP( tool->m_pixmap ); + + GdkBitmap *mask = (GdkBitmap *) NULL; + if (bitmap.GetMask()) mask = bitmap.GetMask()->GetBitmap(); + + gtk_pixmap_set( pixmap, bitmap.GetPixmap(), mask ); + } + } tool->m_owner->OnLeftClick( tool->m_index, tool->m_toggleState ); } @@ -58,10 +74,11 @@ static gint gtk_toolbar_enter_callback( GtkWidget *WXUNUSED(widget), if (g_blockEventsOnDrag) return TRUE; - /* we grey-out the tip text of disabled tool */ wxToolBar *tb = tool->m_owner; + /* we grey-out the tip text of disabled tool */ +#if 0 if (tool->m_enabled) { if (tb->m_fg->red != 0) @@ -105,6 +122,7 @@ static gint gtk_toolbar_enter_callback( GtkWidget *WXUNUSED(widget), #endif } } +#endif /* emit the event */ @@ -273,7 +291,8 @@ wxToolBarTool *wxToolBar::AddTool( int toolIndex, const wxBitmap& bitmap, mask = bitmap.GetMask()->GetBitmap(); tool_pixmap = gtk_pixmap_new( pixmap, mask ); - + gtk_pixmap_set_build_insensitive( GTK_PIXMAP(tool_pixmap), TRUE ); + gtk_misc_set_alignment( GTK_MISC(tool_pixmap), 0.5, 0.5 ); wxToolBarTool *tool = new wxToolBarTool( this, toolIndex, bitmap, pushedBitmap, @@ -355,11 +374,10 @@ void wxToolBar::EnableTool(int toolIndex, bool enable) tool->m_enabled = enable; /* we don't disable the tools for now as the bitmaps don't get - greyed anyway and this also disables tooltips + greyed anyway and this also disables tooltips */ if (tool->m_item) gtk_widget_set_sensitive( tool->m_item, enable ); -*/ return; }