X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7276c69c1c70e26cace37e356de6691ccb59308a..e56fee472c0a59f9b1d45c84a8439e37a1f9925d:/src/gtk/combobox.cpp?ds=inline diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index e2bad2c0c4..40c437fa23 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -290,9 +290,9 @@ wxVisualAttributes wxComboBox::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) { #ifdef __WXGTK3__ - return GetDefaultAttributesFromGTKWidget(gtk_combo_box_new_with_entry, true); + return GetDefaultAttributesFromGTKWidget(gtk_combo_box_new_with_entry(), true); #else - return GetDefaultAttributesFromGTKWidget(gtk_combo_box_entry_new, true); + return GetDefaultAttributesFromGTKWidget(gtk_combo_box_entry_new(), true); #endif } @@ -404,4 +404,21 @@ void wxComboBox::Dismiss() { gtk_combo_box_popdown( GTK_COMBO_BOX(m_widget) ); } + +wxSize wxComboBox::DoGetSizeFromTextSize(int xlen, int ylen) const +{ + wxSize tsize( wxChoice::DoGetSizeFromTextSize(xlen, ylen) ); + + GtkEntry* entry = GetEntry(); + if (entry) + { + // Add the margins we have previously set, but only the horizontal border + // as vertical one has been taken account in the previous call. + // Also get other GTK+ margins. + tsize.IncBy(GTKGetEntryMargins(entry).x, 0); + } + + return tsize; +} + #endif // wxUSE_COMBOBOX