diff --git a/docs/changes.txt b/docs/changes.txt index cba00d6460..1b8ee90d70 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -101,6 +101,7 @@ wxGTK: - Support background colour in wxDataViewCtrl attributes. - Improve wxSpinCtrl best size calculation. - Implement support for icon locations in wxMimeTypesManager (Hanmac). +- Cosmetic fix for empty wxCheckBoxes display (Chuddah). wxMSW: diff --git a/src/gtk/checkbox.cpp b/src/gtk/checkbox.cpp index 166d37cf02..997f81fb55 100644 --- a/src/gtk/checkbox.cpp +++ b/src/gtk/checkbox.cpp @@ -204,6 +204,13 @@ void wxCheckBox::SetLabel( const wxString& label ) { wxCHECK_RET( m_widgetLabel != NULL, wxT("invalid checkbox") ); + // If we don't hide the empty label, in some themes a focus rectangle is + // still drawn around it and this looks out of place. + if ( label.empty() ) + gtk_widget_hide(m_widgetLabel); + else + gtk_widget_show(m_widgetLabel); + // save the label inside m_label in case user calls GetLabel() later wxControl::SetLabel(label);