X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4e621d24713f971d1a2d440f79ccc4593aede4b6..6586750c6a4fa9084eaf5075006ca1fcfe50e818:/src/gtk/stattext.cpp diff --git a/src/gtk/stattext.cpp b/src/gtk/stattext.cpp index 8c25111fbe..6bd76670bb 100644 --- a/src/gtk/stattext.cpp +++ b/src/gtk/stattext.cpp @@ -72,18 +72,16 @@ bool wxStaticText::Create(wxWindow *parent, gtk_label_set_justify(GTK_LABEL(m_widget), justify); - { - // set ellipsize mode - PangoEllipsizeMode ellipsizeMode = PANGO_ELLIPSIZE_NONE; - if ( style & wxST_ELLIPSIZE_START ) - ellipsizeMode = PANGO_ELLIPSIZE_START; - else if ( style & wxST_ELLIPSIZE_MIDDLE ) - ellipsizeMode = PANGO_ELLIPSIZE_MIDDLE; - else if ( style & wxST_ELLIPSIZE_END ) - ellipsizeMode = PANGO_ELLIPSIZE_END; - - gtk_label_set_ellipsize( GTK_LABEL(m_widget), ellipsizeMode ); - } + // set ellipsize mode + PangoEllipsizeMode ellipsizeMode = PANGO_ELLIPSIZE_NONE; + if ( style & wxST_ELLIPSIZE_START ) + ellipsizeMode = PANGO_ELLIPSIZE_START; + else if ( style & wxST_ELLIPSIZE_MIDDLE ) + ellipsizeMode = PANGO_ELLIPSIZE_MIDDLE; + else if ( style & wxST_ELLIPSIZE_END ) + ellipsizeMode = PANGO_ELLIPSIZE_END; + + gtk_label_set_ellipsize( GTK_LABEL(m_widget), ellipsizeMode ); // GTK_JUSTIFY_LEFT is 0, RIGHT 1 and CENTER 2 static const float labelAlignments[] = { 0.0, 1.0, 0.5 }; @@ -106,9 +104,7 @@ void wxStaticText::GTKDoSetLabel(GTKLabelSetter setter, const wxString& label) InvalidateBestSize(); - { - (this->*setter)(GTK_LABEL(m_widget), label); - } + (this->*setter)(GTK_LABEL(m_widget), label); // adjust the label size to the new label unless disabled if ( !HasFlag(wxST_NO_AUTORESIZE) && @@ -195,13 +191,6 @@ bool wxStaticText::SetFont( const wxFont &font ) return ret; } -void wxStaticText::DoSetSize(int x, int y, - int width, int height, - int sizeFlags ) -{ - wxStaticTextBase::DoSetSize(x, y, width, height, sizeFlags); -} - wxSize wxStaticText::DoGetBestSize() const { // Do not return any arbitrary default value... @@ -259,7 +248,7 @@ void wxStaticText::DoSetLabel(const wxString& str) wxVisualAttributes wxStaticText::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) { - return GetDefaultAttributesFromGTKWidget(gtk_label_new); + return GetDefaultAttributesFromGTKWidget(gtk_label_new("")); } #endif // wxUSE_STATTEXT