X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d156af3247c862e51a7c62f569a3fd302052a42..88932ec82d048d006cdc81bd309f5e59aee799ac:/src/gtk/button.cpp diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index cf3fb8b26a..f5f76a7b10 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -18,7 +18,9 @@ #include "wx/stockitem.h" +#include #include "wx/gtk/private.h" +#include "wx/gtk/private/gtk2-compat.h" #include "wx/gtk/private/list.h" // ---------------------------------------------------------------------------- @@ -169,12 +171,12 @@ wxSize wxButtonBase::GetDefaultSize() // button's size. We have to retrieve both values and combine them. GtkWidget *wnd = gtk_window_new(GTK_WINDOW_TOPLEVEL); - GtkWidget *box = gtk_hbutton_box_new(); + GtkWidget *box = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL); GtkWidget *btn = gtk_button_new_from_stock(GTK_STOCK_CANCEL); gtk_container_add(GTK_CONTAINER(box), btn); gtk_container_add(GTK_CONTAINER(wnd), box); GtkRequisition req; - gtk_widget_size_request(btn, &req); + gtk_widget_get_preferred_size(btn, NULL, &req); gint minwidth, minheight; gtk_widget_style_get(box, @@ -269,9 +271,9 @@ GtkLabel *wxButton::GTKGetLabel() const void wxButton::DoApplyWidgetStyle(GtkRcStyle *style) { - gtk_widget_modify_style(m_widget, style); + GTKApplyStyle(m_widget, style); GtkWidget* child = gtk_bin_get_child(GTK_BIN(m_widget)); - gtk_widget_modify_style(child, style); + GTKApplyStyle(child, style); // for buttons with images, the path to the label is (at least in 2.12) // GtkButton -> GtkAlignment -> GtkHBox -> GtkLabel @@ -283,7 +285,7 @@ void wxButton::DoApplyWidgetStyle(GtkRcStyle *style) wxGtkList list(gtk_container_get_children(GTK_CONTAINER(box))); for (GList* item = list; item; item = item->next) { - gtk_widget_modify_style(GTK_WIDGET(item->data), style); + GTKApplyStyle(GTK_WIDGET(item->data), style); } } } @@ -295,7 +297,7 @@ wxSize wxButton::DoGetBestSize() const // extra border around it, but we don't want to take it into account in // our size calculations (otherwise the result is visually ugly), so // always return the size of non default button from here - const bool isDefault = gtk_widget_has_default(m_widget); + const bool isDefault = gtk_widget_has_default(m_widget) != 0; if ( isDefault ) { // temporarily unset default flag @@ -327,7 +329,7 @@ wxSize wxButton::DoGetBestSize() const wxVisualAttributes wxButton::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) { - return GetDefaultAttributesFromGTKWidget(gtk_button_new); + return GetDefaultAttributesFromGTKWidget(gtk_button_new()); } #endif // wxUSE_BUTTON