diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-01-14 10:29:35 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-01-14 16:04:17 +0000 |
commit | d652af7d071bb5e5c3f7592d6dc7e7c400e711d3 (patch) | |
tree | b30375691fdfc2bd8171c7666eeb87cceae15b10 /vcl/unx | |
parent | 02d4f6a2494621a17bb59d743ed499cce555839a (diff) |
merge the 'holy default' default window sizes to a single place
Change-Id: I247a52cf547da268e5aa6f7c9fef000c598b661b
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/generic/window/salframe.cxx | 18 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtkframe.cxx | 22 |
2 files changed, 6 insertions, 34 deletions
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 67ce56e08992..a30c32f145b6 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -31,6 +31,7 @@ #include "vcl/floatwin.hxx" #include "vcl/svapp.hxx" #include "vcl/keycodes.hxx" +#include "vcl/layout.hxx" #include "vcl/printerinfomanager.hxx" #include "vcl/settings.hxx" @@ -331,20 +332,9 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, SalX11Screen nXScreen, SystemP if( nSalFrameStyle & SAL_FRAME_STYLE_SIZEABLE && nSalFrameStyle & SAL_FRAME_STYLE_MOVEABLE ) { - // fill in holy default values brought to us by product management - if( aScreenSize.Width() >= 800 ) - w = 785; - if( aScreenSize.Width() >= 1024 ) - w = 920; - if( aScreenSize.Width() >= 1280 ) - w = 1050; - - if( aScreenSize.Height() >= 600 ) - h = 550; - if( aScreenSize.Height() >= 768 ) - h = 630; - if( aScreenSize.Height() >= 1024 ) - h = 875; + Size aBestFitSize(bestmaxFrameSizeForScreenSize(aScreenSize)); + w = aBestFitSize.Width(); + h = aBestFitSize.Height(); } if( ! mpParent ) { diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 398ece4c300a..6343f5b149f8 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -22,6 +22,7 @@ #include <unx/gtk/gtkinst.hxx> #include <unx/gtk/gtkgdi.hxx> #include <vcl/keycodes.hxx> +#include <vcl/layout.hxx> #include <unx/wmadaptor.hxx> #include <unx/sm.hxx> #include <unx/salbmp.h> @@ -1534,26 +1535,7 @@ void GtkSalFrame::Center() Size GtkSalFrame::calcDefaultSize() { - Size aScreenSize = getDisplay()->GetScreenSize( GetDisplayScreen() ); - long w = aScreenSize.Width(); - long h = aScreenSize.Height(); - - // fill in holy default values brought to us by product management - if( aScreenSize.Width() >= 800 ) - w = 785; - if( aScreenSize.Width() >= 1024 ) - w = 920; - if( aScreenSize.Width() >= 1280 ) - w = 1050; - - if( aScreenSize.Height() >= 600 ) - h = 550; - if( aScreenSize.Height() >= 768 ) - h = 630; - if( aScreenSize.Height() >= 1024 ) - h = 875; - - return Size( w, h ); + return bestmaxFrameSizeForScreenSize(getDisplay()->GetScreenSize(GetDisplayScreen())); } void GtkSalFrame::SetDefaultSize() |