]> git.saurik.com Git - wxWidgets.git/commitdiff
Moved desktop margin options to a more sensible place
authorJulian Smart <julian@anthemion.co.uk>
Tue, 6 Nov 2007 10:52:14 +0000 (10:52 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 6 Nov 2007 10:52:14 +0000 (10:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49678 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/sysopt.tex
src/common/sizer.cpp
src/gtk/utilsgtk.cpp

index a8b885da0aa21195a19645157ae2fd04255bdb77..965b5b2dd47e434b48a08a00e3339030b4287a5b 100644 (file)
@@ -53,6 +53,8 @@ setting it to $0$ makes it always unavailable.}
 environment determination. Supported values are \texttt{GNOME} and \texttt{KDE}.}
 \twocolitem{gtk.window.force-background-colour}{If 1, the backgrounds of windows with the wxBG\_STYLE\_COLOUR background style are cleared forcibly instead
 of relying on the underlying GTK+ window colour. This works around a display problem when running applications under KDE with the gtk-qt theme installed (0.6 and below).}
+\twocolitem{gtk.desktopmargin.x}{The horizontal margin to subtract from the desktop size when Xinerama is not available.}
+\twocolitem{gtk.desktopmargin.y}{The vertical margin to subtract from the desktop size when Xinerama is not available.}
 \end{twocollist}
 
 \wxheading{Mac}
@@ -88,15 +90,6 @@ A reasonable default is used if not specified.}
 \twocolitem{motif.largebuttons}{If 1, uses a bigger default size for wxButtons.}
 \end{twocollist}
 
-\wxheading{All}
-
-\twocolwidtha{7cm}
-\begin{twocollist}\itemsep=0pt
-\twocolitem{{\bf Option}}{{\bf Value}}
-\twocolitem{sizer.desktopmargin.x}{The horizontal margin to subtract from the desktop size when computing the maximum top-level window size in wxSizer::Fit.}
-\twocolitem{sizer.desktopmargin.y}{The vertical margin to subtract from the desktop size when computing the maximum top-level window size in wxSizer::Fit.}
-\end{twocollist}
-
 The compile-time option to include or exclude this functionality
 is wxUSE\_SYSTEM\_OPTIONS.
 
index 364b173dc15c93c3c5a0dda68085858eca5e9a2b..3b1a77280abf9af8d861d6f65069639e28b97a03 100644 (file)
     #include "wx/toplevel.h"
 #endif // WX_PRECOMP
 
-#if wxUSE_SYSTEM_OPTIONS
-#include "wx/sysopt.h"
-#endif
-
 #include "wx/listimpl.cpp"
 
 
@@ -796,13 +792,6 @@ wxSize wxSizer::Fit( wxWindow *window )
             }
 
             sizeMax = wxDisplay(disp).GetClientArea().GetSize();
-
-#if wxUSE_SYSTEM_OPTIONS
-            int marginX = wxSystemOptions::GetOptionInt(wxT("sizer.desktopmargin.x"));
-            int marginY = wxSystemOptions::GetOptionInt(wxT("sizer.desktopmargin.y"));
-            sizeMax.x -= marginX;
-            sizeMax.y -= marginY;
-#endif
         }
     }
 
index 9a3e250f44ccf373aaa2af65fbe8f797fbf0cefa..1abdee7f376b21abd9c8017c55e61d3eb1b8cb49 100644 (file)
     #include "wx/log.h"
 #endif
 
+#include "wx/sysopt.h"
 #include "wx/apptrait.h"
-
 #include "wx/process.h"
 #include "wx/sysopt.h"
-
 #include "wx/unix/execute.h"
 
 #include "wx/gtk/private/timer.h"
@@ -144,8 +143,11 @@ void *wxGetDisplay()
 
 void wxDisplaySize( int *width, int *height )
 {
-    if (width) *width = gdk_screen_width();
-    if (height) *height = gdk_screen_height();
+    int marginX = wxSystemOptions::GetOptionInt(wxT("gtk.desktopmargin.x"));
+    int marginY = wxSystemOptions::GetOptionInt(wxT("gtk.desktopmargin.y"));
+
+    if (width) *width = gdk_screen_width() - marginX;
+    if (height) *height = gdk_screen_height() - marginY;
 }
 
 void wxDisplaySizeMM( int *width, int *height )