[ 1528248 ] Fix to the width of the wxGenericColourButton
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40322 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -71,6 +71,8 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
void UpdateColour();
|
void UpdateColour();
|
||||||
|
|
||||||
// the colour data shown in wxColourPickerCtrlGeneric
|
// the colour data shown in wxColourPickerCtrlGeneric
|
||||||
|
@@ -59,7 +59,8 @@ bool wxColourPickerCtrl::Create( wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
// we are not interested to the ID of our picker as we connect
|
// we are not interested to the ID of our picker as we connect
|
||||||
// to its "changed" event dynamically...
|
// to its "changed" event dynamically...
|
||||||
m_picker = new wxColourPickerWidget(this, wxID_ANY, col, wxPoint(40,0), wxSize(30,-1),
|
m_picker = new wxColourPickerWidget(this, wxID_ANY, col,
|
||||||
|
wxDefaultPosition, wxDefaultSize,
|
||||||
GetPickerStyle(style));
|
GetPickerStyle(style));
|
||||||
|
|
||||||
// complete sizer creation
|
// complete sizer creation
|
||||||
|
@@ -117,4 +117,16 @@ void wxGenericColourButton::UpdateColour()
|
|||||||
SetLabel(m_colour.GetAsString(wxC2S_HTML_SYNTAX));
|
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
|
#endif // wxUSE_COLOURPICKERCTRL
|
||||||
|
Reference in New Issue
Block a user