From: Robin Dunn Date: Tue, 23 May 2006 02:04:01 +0000 (+0000) Subject: I've now seen 2 or 3 themes that need this extra space in a label-less X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c1f50b06ec36d87bfe2c2f559b1b323121b922f8?ds=inline I've now seen 2 or 3 themes that need this extra space in a label-less static box, so I'm checking in my GetBordersForSizer change discussed on wx-dev a few weeks ago. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39277 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gtk/statbox.h b/include/wx/gtk/statbox.h index 90c5abc8c3..437e1836f2 100644 --- a/include/wx/gtk/statbox.h +++ b/include/wx/gtk/statbox.h @@ -42,6 +42,8 @@ public: virtual bool IsTransparentForMouse() const { return TRUE; } + virtual void GetBordersForSizer(int *borderTop, int *borderOther) const; + protected: virtual bool GTKWidgetNeedsMnemonic() const; virtual void GTKWidgetDoSetMnemonic(GtkWidget* w); diff --git a/src/gtk/statbox.cpp b/src/gtk/statbox.cpp index 4d3feeb72b..bb499a7cda 100644 --- a/src/gtk/statbox.cpp +++ b/src/gtk/statbox.cpp @@ -107,4 +107,13 @@ wxStaticBox::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) return GetDefaultAttributesFromGTKWidget(gtk_frame_new); } + +void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const +{ + const int BORDER = 5; // FIXME: hardcoded value + + *borderTop = GetLabel().empty() ? 2*BORDER : GetCharHeight(); + *borderOther = BORDER; +} + #endif // wxUSE_STATBOX