00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include "olayout.h"
00030
00031
00032 #include <opie2/odebug.h>
00033
00034
00035 #include <qapplication.h>
00036
00037 namespace Opie {
00038 namespace Ui {
00039
00040 OAutoBoxLayout::OAutoBoxLayout( QWidget *parent, int border, int space, const char *name )
00041 :QBoxLayout( parent, LeftToRight, border, space, name )
00042 {
00043 fixDirection();
00044 }
00045
00046
00047 OAutoBoxLayout::OAutoBoxLayout( QLayout *parentLayout, int space, const char *name )
00048 :QBoxLayout( parentLayout, LeftToRight, space, name )
00049 {
00050 fixDirection();
00051 }
00052
00053
00054 OAutoBoxLayout::OAutoBoxLayout( int space, const char *name )
00055 :QBoxLayout( LeftToRight, space, name )
00056 {
00057 fixDirection();
00058 }
00059
00060
00061 void OAutoBoxLayout::fixDirection()
00062 {
00063 QWidget* desktop = QApplication::desktop();
00064 int w = desktop->width();
00065 int h = desktop->height();
00066 if ( h > w )
00067 {
00068 odebug << "OAutoBoxLayout: h > w, setting orientation to TopToBottom" << oendl;
00069 setDirection( TopToBottom );
00070 }
00071 }
00072
00073
00074 OAutoBoxLayout::~OAutoBoxLayout()
00075 {
00076 }
00077
00078
00079 };
00080 };
00081
00082
00083