X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/68567a967bc8afd37a40cb9a7ee5021b9ee6cd96..4913272f9cdead94a6d1470e51d6fb14946b50e0:/src/gtk/settings.cpp diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp index d5391ad1e4..1aa49645b0 100644 --- a/src/gtk/settings.cpp +++ b/src/gtk/settings.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: gtk/settings.cpp +// Name: src/gtk/settings.cpp // Purpose: // Author: Robert Roebling // Modified by: Mart Raudsepp (GetMetric) @@ -12,10 +12,19 @@ #include "wx/wxprec.h" #include "wx/settings.h" -#include "wx/debug.h" -#include "wx/cmndata.h" + +#ifndef WX_PRECOMP + #include "wx/cmndata.h" + #include "wx/toplevel.h" +#endif + #include "wx/fontutil.h" -#include "wx/toplevel.h" + +// Using gtk_list_new, which is deprecated since GTK2 +// Using gtk_object_sink, which is deprecated since GTK+-2.9.0 +#ifdef GTK_DISABLE_DEPRECATED +#undef GTK_DISABLE_DEPRECATED +#endif #include #include @@ -125,11 +134,11 @@ static bool GetColourFromGTKWidget(int& red, int& green, int& blue, green = col[state].green; blue = col[state].blue; - ok = TRUE; + ok = true; } else { - ok = FALSE; + ok = false; } gtk_widget_destroy( widget ); @@ -524,14 +533,20 @@ int wxSystemSettingsNative::GetMetric( wxSystemMetric index, wxWindow* win ) "gtk-dnd-drag-threshold", &drag_threshold, NULL); } - return drag_threshold * 2; + // The correct thing here would be to double the value + // since that is what the API wants. But the values + // are much bigger under GNOME than under Windows and + // just seem to much in many cases to be useful. + // drag_threshold *= 2; + + return drag_threshold; // MBN: ditto for icons case wxSYS_ICON_X: return 32; case wxSYS_ICON_Y: return 32; case wxSYS_SCREEN_X: -#if defined(__WXGTK20__) && GTK_CHECK_VERSION(2,2,0) +#if GTK_CHECK_VERSION(2,2,0) if (window && !gtk_check_version(2,2,0)) return gdk_screen_get_width(gdk_drawable_get_screen(window)); else @@ -539,7 +554,7 @@ int wxSystemSettingsNative::GetMetric( wxSystemMetric index, wxWindow* win ) return gdk_screen_width(); case wxSYS_SCREEN_Y: -#if defined(__WXGTK20__) && GTK_CHECK_VERSION(2,2,0) +#if GTK_CHECK_VERSION(2,2,0) if (window && !gtk_check_version(2,2,0)) return gdk_screen_get_height(gdk_drawable_get_screen(window)); else @@ -636,12 +651,12 @@ bool wxSystemSettingsNative::HasFeature(wxSystemFeature index) switch (index) { case wxSYS_CAN_ICONIZE_FRAME: - return FALSE; + return false; case wxSYS_CAN_DRAW_FRAME_DECORATIONS: - return TRUE; + return true; default: - return FALSE; + return false; } }