X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c757b5fee093bbc3686f1e474316396b742fb888..8e190f0ed9c242e6df5fd4dd99fdaf6c9dea1cda:/src/generic/clrpickerg.cpp diff --git a/src/generic/clrpickerg.cpp b/src/generic/clrpickerg.cpp index 497bfa0a01..717b1811ae 100644 --- a/src/generic/clrpickerg.cpp +++ b/src/generic/clrpickerg.cpp @@ -117,4 +117,16 @@ void wxGenericColourButton::UpdateColour() SetLabel(m_colour.GetAsString(wxC2S_HTML_SYNTAX)); } +wxSize wxGenericColourButton::DoGetBestSize() const +{ + wxSize sz(wxButton::DoGetBestSize()); + if ( HasFlag(wxCLRP_SHOW_LABEL) ) + return sz; + + // if we have no label, then make this button a square + // (like e.g. native GTK version of this control) + sz.SetWidth(sz.GetHeight()); + return sz; +} + #endif // wxUSE_COLOURPICKERCTRL